Research Article

Regression Test Selection for C# Programs

Algorithm 1

Algorithm for building the affected class diagram
Input: Set of methods inside the classes;
Set of classes ( ) of the whole program;
AC is an affected class that contains a changed/deleted method;
CD is the class diagram for the whole program;
ACD contains classes that have changed/deleted methods;
Output: set of classes that need to be considered for regression testing;
an Affected Class Diagram (ACD) with the relationship between the classes.
Description: this algorithm is used to select a subset from the whole classes of the
program that are affected by the changes made to the program.
Begin
 For each (AC) do
   Find Base class ( ) for AC from CD // where is the super type of AC
   If ( ) not in ACD
     
      Add ( ) to ACD
      Add an inheritance edge between AC and them
     
- - up to this stage we have a set of changed classes with their base classes in ACD
with the relationship between them.
 For each class AC do
    Get methods of AC
    if AC contains an overridden method
  (for each class ( ) in CD that contains a method that overrides ) do
     
       if ( ) not in ACD
      
        Add ( ) to the ACD Diagram
        Add indirect subtype edge between ( ) and (AC)
      
     
End
- - - Now to find the classes that explicitly reference the changed classes directly or
indirectly use the Trace file.
 Begin
  Open Trace file
   While not EOF (Trace) do
    Read Trace statement
     If ( . calls . ) && ( ) && ( )
      
- -comment: A belongs to and in ACD and the method in belongs to .
       If ( ) not in ACD
        
         Add to ACD
         Add a use edge between and
        
        
      
    End While
End