 Okay, thanks a lot for the invitation. My name is Matias Martinez. I work in the University of the France That's quite near from here from Belgium and I will present a collaboration so and I will present a collaboration that we have Done with Martin Montero's maybe you know Martin Montero's He's working on automatic software repair as me. He was working with me at the University of Lille So today the goal is to present ASTOR. ASTOR is a library or a framework for Building automatic software repair approaches. Okay So the goal of this talk is to introduce automatic software repair and also present ASTOR So what is ASTOR? ASTOR is a framework for building automatic software repair approaches Actually, it provides some routines that the developer can't Reduce and also provides the implementation of five repair approaches that are already implemented and are already ready for use So how come we use ASTOR? ASTOR was used up to now for let's say the world of academic world researchers from different universities that they use ASTOR for creating new repair approaches or For extending those that are already provided But also was used for some software practitioners Which use ASTOR for instance for creating software boots. One of those examples is Repanator is here The reference that was created for Simon Sugli that was here And it was them so you can discuss with him that was a software boots that propose pull request with backfixes So the reason for today is to introduce Automated software repair the domain then to introduce ASTOR Extensions that can we done on some experiments So what is automatic software repair? so basically is So imagine that we have a program that is here. I call P that has a bug So the idea is to take our approach Let's say right now approach. I will not mention details of what is this approach That takes identification of the program specification of P. Also, we can call it Coronets Oracle and the idea is to create a version P that is That his behavior is acceptable with respect with the specification or with the Oracle coordinates Oracle Additionally, this approach can Consume in addition to the source code and the specification some artifacts for instance bug repair reports Traces, etc So in this call, I will discuss or I will mention two kind of approaches for automotive software pair the first of them are The test suites repair approaches that they use test cases as Oracle as a specification So what is the idea? Imagine that we have the program P The specification will be the test case. So that means that we have One fill in this case that means that the program is buggy, okay However, if we have all the test cases that pass that means that the program is okay It's valid. It's valid. We respect with the specification. That means we respect with the test cases So that's the idea. So the idea of this approach is to turn The behavior of to change the behavior of the program with the goal of passing all the test case, okay So on the second family of repair approach that I will mention today is The family of generate and validate approach. So the idea is to generate a candidate patch to validate and to see and to see the result that means in this case whether it pass all the test cases If the result is not success So it generates another patch Until it find a candidate patch that pass all the test cases so They were present a lot of approaches From this family the sweet base repair approaches during the last 10 years but the problem was that those approach was presented in academia so and Prototypes The code source were not always available or in some cases there are we're available, but for Given languages, okay So our idea was to create a platform for Shaba that means written in Shaba and for repair Shaba code. Our idea was to implement the state-of-the-art repair approach And also to provide some extension point to create new repair approaches So we create after That the name came from automatic software transformation for repair. Okay After is available in github is quite easy to use So basically here I put an example of the command Here we have an argument that is mode and here we specify the name of the repair approach that we want to execute For instance here we present three Shades and procs a cali and shame with I will explain our do a small summary of them for Then we say okay mode here the repair Approach that we want to run the location of the of the application that we want to repair. Where is the source code? The dependencies of this project that we want to repair and the output Which other the repair approaches that we have implemented? So the first one is shampoo with one of the most Sighted paper in the field of Autonomous of repair the idea is that Shemp rocks create patches By inserting replacing and remove statements. It works a little level of statements Then another River approach that we have implemented is shame to repair is a very simple approach That basically it mutates operators for instance from here from a greater than B It mutates to a creating an equals to be very easy very simple repair operators And she call it that the goal is to remove code Okay, remove statements. It adds return a statement replace if expression, etc This is the summary of some of the approaches that we have implemented and are already include in Astor We have developed also new repair approaches for instance cardouments that here the goal is to replace expressions that by mining template that we create by By analyzing the source code that creates new instances And the repair there is an extension of Astor For temporary that use similarity to the code for creating new patches. So Here you have the URL to clone Astor here one example as I mentioned before the mode the location the dependencies You can also specify the failing test case. We need at least one failing test case The idea after is to transform the behavior of the program With the goal of that this telling the case pass, but also It's tried to keep the behavior that is correct. That means the test cases that are not failing That continues passing All the test cases and there are a lot of arguments for instance max time. There is a time that We give Astor to find To search a solution So what is the output we provide three outputs The first one the standard outputs that show here a lot of information For instance here is one identifier of the solution and the patch Then we provide a standard An output in JSON format. Okay the same information and also in the file system. We write The patches format the patched version of the program of the fight that was modifier and the patch That you can apply them Into your program. So how does it work? So the inputs of Astor are the buggy program and the Oracle the Oracle in this case are the test cases So the first thing that Astor does is to compute the Suspicion is of components. That means that for each statement of the program It computes or it puts the probability to that this statement is has a failure. Okay It's a number from zero to one and it's the it computes the probability by running the test cases and I'm measuring whether how many of them How many of fell in this case cover the the line Then it creates a program representation That means here we call to program variants a modification point. We'll see later So while they're given a mode of time It selects one suspicious one suspicious line, okay We call it modification point Then we select an operator We apply the generate to apply the repair operator to the statement to generate a patch and Then we validate the patch that means to execute all the test cases So after we end this loop if we find some solutions we sort the solutions according to some criteria So every step can be Customized that means that we can overwrite the behavior the full behavior of one repair approach so This is the list of extension points You can see that here each extension points Can be executed in one step of the workflow for instance here the full localization we can plug in a new implementation the full localization Here in the program representation we can say okay instead of working at the level of Statements we can work at the level of expressions Then here we can say okay. We have these new repair operators So this is the list of extensions that we provide for instance for localization. We have two implementations The list of operators that we provide etc. How how we use the extension points So it's quite easy. So imagine that we have this extension point that is full localization the full localization What it does is to put the probability of suspicion is on each modification point in each statement of the program So the idea is to we have an argument that is full localization And here we put the value in the event we have two approaches for full localization One is chase altar or the other is coconut spawn We simply choose the value But what happened if you want to create a new full localization approach? so Imagine that we create a new full localization approach that That's a new code must implement an interface that we provide And then we pass the name of the class that implement this interface that we have so in the documentation of after we provide for each modification point which is the argument to use in the command line and the interface to implement or after class that should be implemented for each modification point So I will detail three modification points One is the granularity of a modification point. So the modification point are all the places that a repair approach All this let's say all the place that the repair approach can modify Okay, imagine that we have this code that has a bag There are some approaches that work at the level of statements. That means that Each modification point will be one statement. Okay then the repair approach will Transform each modification bond that means in the case of statement, you will replace remove or add Another statement that means that the granularity of the that works a repair approach is a statement However, we can change this granularity To work at the final grind level for instance to work at the level of expression That means that in this case modification points are expression That means that instead of replacing one statement we can work and Replace a particular expression for instance in this case this method in vocation that is an expression expression expression sorry or this operator so See another example that say okay instead of working at the level of expression We want to work at the level of boolean expression. Okay, we want to modify only expression that which evaluation is boolean So that means that with this expression point we can work or we can choose which granularity we want to To work that means to which granularity we want to generate the patch Here we provide Three of four different implementation, but you can create more so then ones that we have choose the granularity That after does is to create From the program under repair the ST We use a spoon for that then we compute the The suspicion is of each line so actually the implementation of full localization of our use work at the level of start of lines So they put for each line of the code the suspicious units values Then we'd say okay given an ST. We are interested in of some only some subset of AST nodes, okay, that is according with the granularity of the modification point that we want imagine that we want To work at the level of statements We only choose the node that are statements or if we want to work at the level of boolean expression. We only choose the the node that are boolean expressions And then we create the modification point by combining the information for granularity and Suspicion is so finally once that we have the all the modification points, sorry We need to The repair operator that needs the operator that we will apply on each location So for that after Has an extension point to say okay, which are the operators that we provide We can reduce the operator that we have already in implement or we can create new ones so here also we have an argument that is Operator space that we can put the value of The operators in this case suppression means all the operator that removes code But also we can create new operators by Here we have the interface or sorry the after class with some methods one of them is It can be applied to point It will receive a modification point that means for instance a statement and return true or false whether This operator can be applied to this point and another method that we that must be implemented by an operator is given a modification point to create an instance of a list of operator instance that means a List with possible changes that can be done in this point Here the same if we have new operators in new classes we can pass in the repair operator arguments, okay, finally we have some extension point that are related with Ingredients so in that case for for instance here ingredient pool definition selection of ingredients What is the ingredient in this context? so after has two Kind of operators one is what we call autonomous operator That are used for instance for shemutation repair there are operators that don't need any information, okay? imagine that this if so we can apply a mutation in this operator in the greater And we have here different candidates However, we have another category that is ingredient based operator that means That this operator to synthesize the patch Need some information This information can be another piece of piece of code at template whatever For instance station pro has two ingredient base Operators at and replace that means we mentioned that we have an statement that we want to replace one statement We need another statement to be the replacement So imagine this case that we have this suspicious statement this assignment And we have an operator that from shem pro that say add a new statement after these suspicious So here the question is okay What the statement we should add so after has an ingredient pool which has all the candidate statement that can be inserted here Then it will be select one. Let's say random Let's say return M and create the new patch So this attention point allows to create different strategies for creating the ingredient pool so that means to create in this database of possible Ingredients possible that we will use to create the patch for selecting one of them and For transforming this ingredient for instance to replace the variables that are not on the scope Here we have implement For these Extension points strategies that are materialized in the deep repair approach basically here we have Implement one strategy to select the ingredients according to the similarity and another strategy for adapt an ingredient that has variables auto scope according to The semantic meaning of the identifiers so we have done several Evaluation of astor or the approach that are built of astor one of them was It's based on one that a set of bugs that the name is defective shape that has Different open source implement Approaches and sorry and Bugs Imagine that here each box or for instance for common lengths the data set has 65 bugs and on average they have 2000 Test cases that means that there are large applications I'm here Our approach will pair for instance in this experiment repair 33 bags out of 224 that means a 14 percent 14 percent sorry that means that this repair This dispatches that we are that we are able to generate Produce that all the test cases Pass okay, but it doesn't mean that the repair are correct. Why because There are some changes that produce that The all the failing test case pass Bar are not correct. And why are not correct because the specification is weak That means that is missing some input for validate The test the candidate Patch so the thing that we are working right now is to try to create new test cases to have more Test cases for validating over patches. So conclusions. So I Have present our repair Framework for for repair and Shaba code and is implemented in Shaba includes three repairs Algorithms that were presented by the research community We also provide some extension points for creating new approaches so the source code is available, so if you have any questions or Pack fix or improvement or collaborations. You don't hesitate to contact us. Okay Okay, thanks a lot Yes, so the question that he your name Yes Yes, actually yes, so His personal is that our approach is offline with coordinate me And then we instrument the code Okay, we run all the test cases. Okay that we have all the instrumented program and Using this information We compute the suspiciousness of each line of the program That is based on the coverage Of the test cases and based on this information of suspicion is we compute some Let's say suspicion is matrix to know to have an order of the list of suspicion is and then we apply repair operators over these Suspicious statements, so which sort of which function? Okay, so if he question is about the speed of patching so the time that That the approach is takes to find a patch so it will depend of the search space of the of the program for some patches the search space is quite small because the suspicion is Super space is small So for that it will take some minutes for others it takes around Hours hours So so either actually we run the experiments for two three four hours no more than that No, no, so the question if you have applied the question in C++ We haven't we haven't tried with another With another problem language so to repair another problem language But for instance for the approach that we have implemented shape shenprok the original Implementation is for repairing C code so that means that this approach is already implemented in C code