SlideShare a Scribd company logo
SAFE-COMMIT Analysis to Facilitate
           Team Software Development
           Jan Wloka
           PROLANGS
           Rutgers University




                                        Barbara G. Ryder     Frank Tip       Xiaoxia Ren
                                          Virginia Tech    IBM Research   Rutgers University
© Jan Wloka 2009 All Rights reserved.
Parallel Work on Shared Code

                Problems: Merge conflicts, duplicative work
                   Revision control systems (RCS) detect
                   quot;directquot; merge conflicts
                   Commit policy governs commit process
                                        “Commit early and commit often.”
                                        “Don’t commit compilation or test failures.”




© Jan Wloka 2009 All Rights reserved.                                                  2
Parallel Work on Shared Code

                Problems: Merge conflicts, duplicative work
                   Revision control systems (RCS) detect
                   quot;directquot; merge conflicts
                   Commit policy governs commit process
                                        “Commit early and commit often.”
                                        “Don’t commit compilation or test failures.”
                Problems are still not solved!
                   RCS offer limited conflict detection/resolution
                   Policies are not enforced
                   Policies may be too restrictive

© Jan Wloka 2009 All Rights reserved.                                                  2
Enforceable SAFE-COMMIT Policies

                      Idea: Observe effects on test results to detect unsafe
                      changes, e.g.:
                         Changes affect a failing test
                         Changes affect a worsening test
                         Changes not tested




© Jan Wloka 2009 All Rights reserved.                                          3
Enforceable SAFE-COMMIT Policies

                      Idea: Observe effects on test results to detect unsafe
                      changes, e.g.:
                         Changes affect a failing test
                         Changes affect a worsening test
                         Changes not tested
                      Policies of varying degrees of strictness (intuition)
                         Commit changes that affect only passing tests
                         Commit changes that affect only non-worsening tests
                         Commit changes that don’t degrade test outcomes

© Jan Wloka 2009 All Rights reserved.                                          3
Change Models
                                        [PASTE’01, OOPSLA’04, ICSE’05, TSE’06, ICSE’09]

                      Decompose an edit into 19 distinct atomic changes
                        Reflecting language semantics
                        Are atomic
                      Potential change in dispatch behavior
                        Lookup change: explicit effect on a dispatch entry
                      Inter-dependences between changes
                         Syntactic, structural requirements
                         Cause – effect mapping


© Jan Wloka 2009 All Rights reserved.                                                     4
Explicit Representation of Change
   class A {                                     public class Tests extends TestCase {   Test
     int y;                                        public void test1() {
     int zip(int x) {                                A a = new A();
       this.y = x;                                   a.bar(3);                           test
       x = zap(x);                                   assertEquals(5, a.zip(3));
                                                                                         test
       return x + 2;                               }
                                                   public void test2() {                 test
     }
                                                     A a = new A();
     int zap(int x) { return 2 * x; }                                                    test
                                                     int temp = a.bar(2);
     int foo(int x) { return 2 * x; }
                                                     assertEquals(2, a.foo(temp));       test
     int bar(int x) { return x / 2 ; }             }
     int wiff(int x) { return x; }                 public void test3() {
     int baz(int x) { return x + 1; }                B b = new B();
     int val() { return 2; }                         assertEquals(5, b.waff(5));
   }                                               }
   class B extends A {                             public void test4() {
     int waff(int x) { this.y = x; return x; }       B b = new B();
     int bla(int x) { return 7 + this.val(); }       assertEquals(8, b.bla(5));
     int val() { return 1; }                       }
                                                   public void test5() {
   }
                                                     A a = new B();
                                                     assertEquals(a.baz(1), a.val());
                                                   }
© Jan Wloka 2009 All Rights reserved.            }                                       5
Explicit Representation of Change
                                                 Class
   class A {                                       A     public class Tests extends TestCase {          Test
                                                           Method void test1() Method
                                                           public        Method    {         Method
     int y;
                                                           foo(int) = new A();
                                                              A a        bar(int)  wiff(int) baz(int)
     int zip(int x) {
       this.y = x;                                            a.bar(3);                                 test
       x = zap(x);                                            assertEquals(5, a.zip(3));
                                                                                                        test
       return x + 2;                                       }
                                                           public void test2() {                        test
     }
                                                              A a = new A();
     int zap(int x) { return 2 * x; }                                                                   test
                                                            Field tempMethod
                                                              int         = a.bar(2);
                                                                                   Method    Method
     int foo(int x) { return 2 * x; }
                                                              assertEquals(2, a.foo(temp)); val()
                                                              y          zip(int)    zap()              test
     int bar(int x) { return x / 2 ; }                     }
     int wiff(int x) { return x; }                         public void test3() {
     int baz(int x) { return x + 1; }            Class        B b = new B();
     int val() { return 2; }                       B
                                                              assertEquals(5, b.waff(5));
   }                                                       }
   class B extends A {                                     Method void test4() Method
                                                           public        Method    {
     int waff(int x) { this.y = x; return x; }             waff(int) = new B();
                                                              B b        bla(int)    val()
     int bla(int x) { return 7 + this.val(); }                assertEquals(8, b.bla(5));
     int val() { return 1; }                               }
                                                           public void test5() {
   }
                                                              A a = new B();
                                                              assertEquals(a.baz(1), a.val());
                                                           }
© Jan Wloka 2009 All Rights reserved.                    }                                              5
Explicit Representation of Change
                                                 Class
   class A {                                       A     public class Tests extends TestCase {          Test
                                                           Method void test1() Method
                                                           public        Method    {         Method
     int y;
                                                           foo(int) = new A();
                                                              A a        bar(int)  wiff(int) baz(int)
     int zip(int x) {
       this.y = x;                                            a.bar(3);           AM                    test
       x = zap(x);                                            assertEquals(5, a.zip(3));
                                                                                                        test
       return x + 2;                                       }
                                                           public void test2() {                        test
     }
                                                              A a = new A();
     int zap(int x) { return 2 * x; }                                                                   test
                                                            Field tempMethod
                                                              int         = a.bar(2);
                                                                                   Method    Method
     int foo(int x) { return 2 * x; }
                                                              assertEquals(2, a.foo(temp)); val()
                                                              y          zip(int)    zap()              test
     int bar(int x) { return x / 2 ; }                     }
                                                          AF                      AM
     int wiff(int x) { return x; }                         public void test3() {
     int baz(int x) { return x + 1; }            Class        B b = new B();
     int val() { return 2; }                       B
                                                              assertEquals(5, b.waff(5));
   }                                                       }
   class B extends A {                                     Method void test4() Method
                                                           public        Method    {
     int waff(int x) { this.y = x; return x; }             waff(int) = new B();
                                                              B b        bla(int)    val()
     int bla(int x) { return 7 + this.val(); }                assertEquals(8, b.bla(5));
                                                                                  DM
     int val() { return 1; }                               }
                                                           public void test5() {
   }
                                                              A a = new B();
                                                              assertEquals(a.baz(1), a.val());
                                                           }
© Jan Wloka 2009 All Rights reserved.                    }                                              5
Explicit Representation of Change
                                                 Class
   class A {                                       A     public class Tests extends TestCase {            Test
                                                           Method void test1() Method
                                                           public        Method    {          Method
     int y;
                                                           foo(int) = new A();
                                                              A a        bar(int)   wiff(int)  baz(int)
     int zip(int x) {
                                                          CM a.bar(3);  CM        AM          CM          test
       this.y = x;
                                                                                   CM
                                                              assertEquals(5, a.zip(3));
       x = zap(x);                                                                                        test
       return x + 2;                                       }
                                                           public void test2() {                          test
     }
                                                              A a = new A();
     int zap(int x) { return 2 * x; }                                                                     test
                                                            Field tempMethod
                                                              int         = a.bar(2);
                                                                                   Method     Method
     int foo(int x) { return 2 * x; }
                                                              assertEquals(2, a.foo(temp)); val()
                                                              y          zip(int)    zap()                test
     int bar(int x) { return x / 2 ; }                     }
                                                          AF            CM        AM
     int wiff(int x) { return x; }                         public void test3() CM  {
     int baz(int x) { return x + 1; }            Class        B b = new B();
     int val() { return 2; }                       B
                                                              assertEquals(5, b.waff(5));
   }                                                       }
   class B extends A {                                     Method void test4() Method
                                                           public        Method    {
     int waff(int x) { this.y = x; return x; }             waff(int) = new B();
                                                              B b        bla(int)    val()
     int bla(int x) { return 7 + this.val(); }            CM assertEquals(8, b.bla(5));
                                                                        CM        DM
     int val() { return 1; }                               }
                                                                                   CM
                                                           public void test5() {
   }
                                                              A a = new B();
                                                              assertEquals(a.baz(1), a.val());
                                                           }
© Jan Wloka 2009 All Rights reserved.                    }                                                5
Explicit Representation of Change
                                                 Class
   class A {                                       A     public class Tests extends TestCase {            Test
                                                           Method void test1() Method
                                                           public        Method    {          Method
     int y;
                                                           foo(int) = new A();
                                                              A a        bar(int)   wiff(int)  baz(int)
     int zip(int x) {
                                                          CM a.bar(3);  CM        AM          CM          test
       this.y = x;
                                                                                   CM
                                                              assertEquals(5, a.zip(3));
       x = zap(x);                                                                                        test
       return x + 2;                                       }
                                                           public void test2() {                          test
     }
                                                              A a = new A();
     int zap(int x) { return 2 * x; }                                                                     test
                                                            Field tempMethod
                                                              int         = a.bar(2);
                                                                                   Method     Method
     int foo(int x) { return 2 * x; }
                                                              assertEquals(2, a.foo(temp)); val()
                                                              y          zip(int)    zap()                test
     int bar(int x) { return x / 2 ; }                     }
                                                          AF            CM        AM
     int wiff(int x) { return x; }                         public void test3() CM  {
     int baz(int x) { return x + 1; }            Class        B b = new B();
     int val() { return 2; }                       B
                                                              assertEquals(5, b.waff(5));
   }                                                       }
   class B extends A {                                     Method void test4() Method
                                                           public        Method    {
     int waff(int x) { this.y = x; return x; }             waff(int) = new B();
                                                              B b        bla(int)    val()
     int bla(int x) { return 7 + this.val(); }            CM assertEquals(8, b.bla(5));
                                                                        CM        DM
     int val() { return 1; }                               }
                                                                                   CM
                                                           public void test5() {
   }
                                                              A a = new B();
                                                              assertEquals(a.baz(1), a.val());
                                                           }
© Jan Wloka 2009 All Rights reserved.                    }                                                5
Explicit Representation of Change
                                                 Class
   class A {                                       A     public class Tests extends TestCase {            Test
                                                           Method void test1() Method
                                                           public        Method    {           Method
     int y;
                                                           foo(int) = new A();
                                                              A a        bar(int)   wiff(int)  baz(int)
     int zip(int x) {
                                                          CM a.bar(3);  CM        AM          CM          test
       this.y = x;
                                                                                   CM
                                                              assertEquals(5, a.zip(3));
       x = zap(x);                                                                                        test
                                                           }                       LC
       return x + 2;
                                                           public void test2() {   LC                     test
     }
                                                              A a = new A();
     int zap(int x) { return 2 * x; }                                                                     test
                                                            Field tempMethod
                                                              int         = a.bar(2);
                                                                                   Method      Method
     int foo(int x) { return 2 * x; }
                                                              assertEquals(2, a.foo(temp)); val()
                                                              y          zip(int)    zap()                test
     int bar(int x) { return x / 2 ; }                     }
                                                          AF            CM        AM          LC
     int wiff(int x) { return x; }                         public void test3() CM  {
     int baz(int x) { return x + 1; }            Class        B b = new B();
                                                   B                               LC
     int val() { return 2; }                                  assertEquals(5, b.waff(5));
                                                                                   LC
   }                                                       }
   class B extends A {                                     Method void test4() Method
                                                           public        Method    {
     int waff(int x) { this.y = x; return x; }             waff(int) = new B();
                                                              B b        bla(int)    val()
     int bla(int x) { return 7 + this.val(); }            CM assertEquals(8, b.bla(5));
                                                                        CM        DM
     int val() { return 1; }                               }
                                                                                   CM
                                                           public void test5() {
   }                                                                               LC
                                                              A a = new B();
                                                              assertEquals(a.baz(1), a.val());
                                                           }
© Jan Wloka 2009 All Rights reserved.                    }                                                5
Determining Effects on Program
           Behavior
                      Program Source Code                   Atomic Change Model   Program Behavior



           AST :: original

                                            P

                            I                       C


                            M                       M



            AST :: edited

                                            P

                        I                   C           C


                       M                M       M   M




© Jan Wloka 2009 All Rights reserved.                                                                6
Determining Effects on Program
           Behavior
                      Program Source Code                   Atomic Change Model   Program Behavior



           AST :: original

                                            P

                            I                       C

                                                            C
                            M                       M


                                                            M         M
            AST :: edited

                                            P

                        I                   C           C


                       M                M       M   M




© Jan Wloka 2009 All Rights reserved.                                                                6
Determining Effects on Program
           Behavior
                      Program Source Code                   Atomic Change Model     Program Behavior



           AST :: original

                                            P

                            I                       C
                                                                 AC
                                                            C
                            M                       M

                                                                AM        AM
                                                            M         M
            AST :: edited

                                            P                    CM            CM

                        I                   C           C


                       M                M       M   M




© Jan Wloka 2009 All Rights reserved.                                                                  6
Determining Effects on Program
           Behavior
                      Program Source Code                   Atomic Change Model          Program Behavior



           AST :: original                                                          LC
                                            P
                                                                                    LC
                            I                       C
                                                                 AC
                                                            C
                            M                       M
                                                                                    LC
                                                                AM        AM
                                                            M         M
            AST :: edited

                                            P                    CM            CM

                        I                   C           C


                       M                M       M   M




© Jan Wloka 2009 All Rights reserved.                                                                       6
Determining Effects on Program
           Behavior
                      Program Source Code                   Atomic Change Model          Program Behavior



           AST :: original                                                          LC
                                                                                                call graph :: test1
                                            P
                                                                                    LC
                            I                       C
                                                                 AC
                                                            C
                            M                       M
                                                                                    LC
                                                                AM        AM                    call graph :: test2
                                                            M         M
            AST :: edited

                                            P                    CM            CM

                        I                   C           C


                       M                M       M   M




© Jan Wloka 2009 All Rights reserved.                                                                                 6
Determining Effects on Program
           Behavior
                      Program Source Code                   Atomic Change Model          Program Behavior



           AST :: original                                                          LC
                                                                                                call graph :: test1
                                            P
                                                                                    LC
                            I                       C
                                                                 AC
                                                            C
                            M                       M
                                                                                    LC
                                                                AM        AM                    call graph :: test2
                                                            M         M
            AST :: edited

                                            P                    CM            CM

                        I                   C           C


                       M                M       M   M




© Jan Wloka 2009 All Rights reserved.                                                                                 6
Determining Effects on Program
           Behavior
                      Program Source Code                   Atomic Change Model          Program Behavior



           AST :: original                                                          LC
                                                                                                call graph :: test1
                                            P
                                                                                    LC
                            I                       C
                                                                 AC
                                                            C
                            M                       M
                                                                                    LC
                                                                AM        AM                    call graph :: test2
                                                            M         M
            AST :: edited

                                            P                    CM            CM

                        I                   C           C


                       M                M       M   M




© Jan Wloka 2009 All Rights reserved.                                                                                 6
Determining Effects on Program
           Behavior
                      Program Source Code                   Atomic Change Model          Program Behavior



           AST :: original                                                          LC
                                                                                                call graph :: test1
                                            P
                                                                                    LC
                            I                       C
                                                                 AC
                                                            C
                            M                       M
                                                                                    LC
                                                                AM        AM                    call graph :: test2
                                                            M         M
            AST :: edited

                                            P                    CM            CM

                        I                   C           C


                       M                M       M   M




© Jan Wloka 2009 All Rights reserved.                                                                                 6
Determining Effects on Program
           Behavior
                      Program Source Code                   Atomic Change Model          Program Behavior



           AST :: original                                                          LC
                                                                                                call graph :: test1
                                            P
                                                                                    LC
                            I                       C
                                                                 AC
                                                            C
                            M                       M
                                                                                    LC
                                                                AM        AM                    call graph :: test2
                                                            M         M
            AST :: edited

                                            P                    CM            CM

                        I                   C           C


                       M                M       M   M




© Jan Wloka 2009 All Rights reserved.                                                                                 6
Determining Effects on Program
           Behavior
                      Program Source Code                   Atomic Change Model          Program Behavior



           AST :: original                                                          LC
                                                                                                call graph :: test1
                                            P
                                                                                    LC
                            I                       C
                                                                 AC
                                                            C
                            M                       M
                                                                                    LC
                                                                AM        AM                    call graph :: test2
                                                            M         M
            AST :: edited

                                            P                    CM            CM

                        I                   C           C


                       M                M       M   M




© Jan Wloka 2009 All Rights reserved.                                                                                 6
Classifications of Unsafe Changes

                      Definition Change Coverage: A change c is covered by a
                      test t if
                      (i) c is exercised by t
                      (ii) c depends on c′, c′ is covered by t, or
                      (iii) c′ depends on c , c′ is covered by t.




© Jan Wloka 2009 All Rights reserved.                                         7
Classifications of Unsafe Changes

                      Definition Change Coverage: A change c is covered by a
                      test t if
                      (i) c is exercised by t
                      (ii) c depends on c′, c′ is covered by t, or  Test Outcomes
                                                                     pass → pass
                      (iii) c′ depends on c , c′ is covered by t.     fail → pass
                      Classification of test outcomes                   pass → fail
                                                                        fail → fail
                         Passing: {p→p, f→p, ∅→p}                      ∅ → pass
                         Not worsening: Passing + {f→f, ∅→f}             ∅ → fail
                                                                       pass → ∅
                         Worsening: {p→f}
                                                                         fail → ∅


© Jan Wloka 2009 All Rights reserved.                                                 7
Classifications of Unsafe Changes

                      Definition Change Coverage: A change c is covered by a
                      test t if
                      (i) c is exercised by t
                      (ii) c depends on c′, c′ is covered by t, or  Test Outcomes
                                                                     pass → pass
                      (iii) c′ depends on c , c′ is covered by t.     fail → pass
                      Classification of test outcomes                   pass → fail
                                                                        fail → fail
                         Passing: {p→p, f→p, ∅→p}                      ∅ → pass
                         Not worsening: Passing + {f→f, ∅→f}             ∅ → fail
                                                                       pass → ∅
                         Worsening: {p→f}
                                                                         fail → ∅

            ➾ E.g, c is unsafe, because it’s covered by a worsening test.
© Jan Wloka 2009 All Rights reserved.                                                 7
Preserving Test Behavior
          public class Tests extends TestCase {
            public void test1() {
              A a = new A();
              a.bar(3);
              assertEquals(5, a.zip(3));
            }
            public void test2() { /* ... */ }
            public void test3() { /* ... */ }
            public void test4() { /* ... */ }
            public void test5() { /* ... */ }
          }

{        Test Results

                           original         edited
         test1                 !             quot;
         test2                 !             !
         test3                 !             !
         test4                 !             quot;
         test5                 !             !

    © Jan Wloka 2009 All Rights reserved.            8
Preserving Test Behavior
          public class Tests extends TestCase {
            public void test1() {
              A a = new A();
              a.bar(3);
              assertEquals(5, a.zip(3));                                 Tests.test1()
            }
                                                                  <A,A.bar()> <A,A.zip()>
            public void test2() { /* ... */ }
            public void test3() { /* ... */ }
                                                     A.A()   A.bar()         A.zip()         Assert.assertEquals()
            public void test4() { /* ... */ }
            public void test5() { /* ... */ }
          }                                                                      <A,A.zap()>


{        Test Results                                                                       A.zap()

                           original         edited
         test1                 !             quot;
         test2                 !             !
         test3                 !             !
         test4                 !             quot;
         test5                 !             !

    © Jan Wloka 2009 All Rights reserved.                                                                            8
Preserving Test Behavior
          public class Tests extends TestCase {
            public void test1() {
              A a = new A();
              a.bar(3);
              assertEquals(5, a.zip(3));                                                       Tests.test1()
            }
                                                                                        <A,A.bar()> <A,A.zip()>
            public void test2() { /* ... */ }
            public void test3() { /* ... */ }
                                                                      A.A()       A.bar()          A.zip()         Assert.assertEquals()
            public void test4() { /* ... */ }
            public void test5() { /* ... */ }                                     CM1            CM2
          }                                                                                            <A,A.zap()>


{        Test Results                                                                                             A.zap()
                                                     CM:B.waff()         AF:A.y
                           original         edited                                                           CM3
                                                                                                             LC1
         test1                 !             quot;
                                                               LC2:<B,A.zap()>           AM1:A.zap()
         test2                 !             !
         test3                 !             !
         test4                 !             quot;
         test5                 !             !

    © Jan Wloka 2009 All Rights reserved.                                                                                                  8
Preserving Test Behavior
          public class Tests extends TestCase {
            public void test1() {
              A a = new A();
              a.bar(3);
              assertEquals(5, a.zip(3));                                                       Tests.test1()
            }
                                                                                        <A,A.bar()> <A,A.zip()>
            public void test2() { /* ... */ }
            public void test3() { /* ... */ }
                                                                      A.A()       A.bar()          A.zip()         Assert.assertEquals()
            public void test4() { /* ... */ }
            public void test5() { /* ... */ }                                     CM1            CM2
          }                                                                                            <A,A.zap()>


{        Test Results                                                                                             A.zap()
                                                     CM:B.waff()         AF:A.y
                           original         edited                                                           CM3
                                                                                                             LC1
         test1                 !             quot;
                                                               LC2:<B,A.zap()>           AM1:A.zap()
         test2                 !             !
         test3                 !             !
         test4                 !             quot;
         test5                 !             !

    © Jan Wloka 2009 All Rights reserved.                                                                                                  8
Preserving Test Behavior
          public class Tests extends TestCase {
            public void test1() {
              A a = new A();
              a.bar(3);
              assertEquals(5, a.zip(3));                                                       Tests.test1()
            }
                                                                                        <A,A.bar()> <A,A.zip()>
            public void test2() { /* ... */ }
            public void test3() { /* ... */ }
                                                                      A.A()       A.bar()          A.zip()         Assert.assertEquals()
            public void test4() { /* ... */ }
            public void test5() { /* ... */ }                                     CM1            CM2
          }                                                                                            <A,A.zap()>


{        Test Results                                                                                             A.zap()
                                                     CM:B.waff()         AF:A.y
                           original         edited                                                           CM3
                                                                                                             LC1
         test1                 !             quot;
                                                               LC2:<B,A.zap()>           AM1:A.zap()
         test2                 !             !
         test3                 !             !
         test4                 !             quot;
         test5                 !             !

    © Jan Wloka 2009 All Rights reserved.                                                                                                  8
Preserving Test Behavior
          public class Tests extends TestCase {
            public void test1() {
              A a = new A();
              a.bar(3);
              assertEquals(5, a.zip(3));                                                       Tests.test1()
            }
                                                                                        <A,A.bar()> <A,A.zip()>
            public void test2() { /* ... */ }
            public void test3() { /* ... */ }
                                                                      A.A()       A.bar()          A.zip()         Assert.assertEquals()
            public void test4() { /* ... */ }
            public void test5() { /* ... */ }                                     CM1            CM2
          }                                                                                            <A,A.zap()>


{        Test Results                                                                                             A.zap()
                                                     CM:B.waff()         AF:A.y
                           original         edited                                                           CM3
                                                                                                             LC1
         test1                 !             quot;
                                                               LC2:<B,A.zap()>           AM1:A.zap()
         test2                 !             !
         test3                 !             !
         test4                 !             quot;
                                                                   {CM1, CM2, CM3, LC1, LC2, AM1}
         test5                 !             !                        may affect a worsening test.
    © Jan Wloka 2009 All Rights reserved.                                                                                                  8
SAFE-COMMIT Algorithm                               Sk etch

          Input: CHANGES, EXERCISED(t), COVERED(t), INPUTTESTS
                    Add INPUTTESTS to set PRESERVEDTESTS
                    Step1: Selection of NONCOMMITTABLE
                       Find changes in EXERCISED(t)
                       Find changes in DEPENDENCES(c)
                    Step2: Selection of new PRESERVEDTESTS
                       Find tests t : COVERED(t) contains c in NONCOMMITTABLE
                    COMMITTABLE= CHANGES  (NONCOMMITTABLE ∪ UNCOVERED)
          Output: COMMITTABLE, PRESERVEDTESTS

© Jan Wloka 2009 All Rights reserved.                                           9
SAFE-COMMIT Example Run
   Example: Find all successfully tested changes.
                          AM:A.zap()            LC:<A, A.zap()>       CM:A.bar()            CM:A.foo()




                                        CM:A.zap           test1()          test2()               test3()



                     LC:<B, A.zap()>      CM:A.zip()                        AF:A.y                                CM:B.waff()



                                                                                   DM:B.val()                                   LC:<B, A.val()>
                                             CM:A.wiff()



                          AM:B.wiff()        LC:<A, A.wiff()>        CM:B.bla()       LC:<[B, B.val()>        CM:B.val()

                                                                                                                                CM:A.baz()
                                             LC:<B, A.wiff()>
                                                                                  test4()                   test5()




© Jan Wloka 2009 All Rights reserved.                                                                                                             10
SAFE-COMMIT Example Run
   Example: Find all successfully tested changes.
                          AM:A.zap()            LC:<A, A.zap()>       CM:A.bar()            CM:A.foo()




                                        CM:A.zap           test1()          test2()               test3()



                     LC:<B, A.zap()>      CM:A.zip()                        AF:A.y                                CM:B.waff()



                                                                                   DM:B.val()                                   LC:<B, A.val()>
                                             CM:A.wiff()



                          AM:B.wiff()        LC:<A, A.wiff()>        CM:B.bla()       LC:<[B, B.val()>        CM:B.val()

                                                                                                                                CM:A.baz()
                                             LC:<B, A.wiff()>
                                                                                  test4()                   test5()




© Jan Wloka 2009 All Rights reserved.                                                                                                             10
SAFE-COMMIT Example Run
   Example: Find all successfully tested changes.
                          AM:A.zap()            LC:<A, A.zap()>       CM:A.bar()            CM:A.foo()




                                        CM:A.zap           test1()          test2()               test3()



                     LC:<B, A.zap()>      CM:A.zip()                        AF:A.y                                CM:B.waff()



                                                                                   DM:B.val()                                   LC:<B, A.val()>
                                             CM:A.wiff()



                          AM:B.wiff()        LC:<A, A.wiff()>        CM:B.bla()       LC:<[B, B.val()>        CM:B.val()

                                                                                                                                CM:A.baz()
                                             LC:<B, A.wiff()>
                                                                                  test4()                   test5()




© Jan Wloka 2009 All Rights reserved.                                                                                                             10
SAFE-COMMIT Example Run
   Example: Find all successfully tested changes.
                          AM:A.zap()            LC:<A, A.zap()>       CM:A.bar()            CM:A.foo()




                                        CM:A.zap           test1()          test2()               test3()



                     LC:<B, A.zap()>      CM:A.zip()                        AF:A.y                                CM:B.waff()



                                                                                   DM:B.val()                                   LC:<B, A.val()>
                                             CM:A.wiff()



                          AM:B.wiff()        LC:<A, A.wiff()>        CM:B.bla()       LC:<[B, B.val()>        CM:B.val()

                                                                                                                                CM:A.baz()
                                             LC:<B, A.wiff()>
                                                                                  test4()                   test5()




© Jan Wloka 2009 All Rights reserved.                                                                                                             10
SAFE-COMMIT Example Run
   Example: Find all successfully tested changes.
                          AM:A.zap()            LC:<A, A.zap()>       CM:A.bar()            CM:A.foo()




                                        CM:A.zap           test1()          test2()               test3()



                     LC:<B, A.zap()>      CM:A.zip()                        AF:A.y                                CM:B.waff()



                                                                                   DM:B.val()                                   LC:<B, A.val()>
                                             CM:A.wiff()



                          AM:B.wiff()        LC:<A, A.wiff()>        CM:B.bla()       LC:<[B, B.val()>        CM:B.val()

                                                                                                                                CM:A.baz()
                                             LC:<B, A.wiff()>
                                                                                  test4()                   test5()




© Jan Wloka 2009 All Rights reserved.                                                                                                             10
SAFE-COMMIT Example Run
   Example: Find all successfully tested changes.
                          AM:A.zap()            LC:<A, A.zap()>       CM:A.bar()            CM:A.foo()




                                        CM:A.zap           test1()          test2()               test3()



                     LC:<B, A.zap()>      CM:A.zip()                        AF:A.y                                CM:B.waff()



                                                                                   DM:B.val()                                   LC:<B, A.val()>
                                             CM:A.wiff()



                          AM:B.wiff()        LC:<A, A.wiff()>        CM:B.bla()       LC:<[B, B.val()>        CM:B.val()

                                                                                                                                CM:A.baz()
                                             LC:<B, A.wiff()>
                                                                                  test4()                   test5()




© Jan Wloka 2009 All Rights reserved.                                                                                                             10
SAFE-COMMIT Example Run
   Example: Find all successfully tested changes.
                          AM:A.zap()            LC:<A, A.zap()>       CM:A.bar()            CM:A.foo()




                                        CM:A.zap           test1()          test2()               test3()



                     LC:<B, A.zap()>      CM:A.zip()                        AF:A.y                                CM:B.waff()



                                                                                   DM:B.val()                                   LC:<B, A.val()>
                                             CM:A.wiff()



                          AM:B.wiff()        LC:<A, A.wiff()>        CM:B.bla()       LC:<[B, B.val()>        CM:B.val()

                                                                                                                                CM:A.baz()
                                             LC:<B, A.wiff()>
                                                                                  test4()                   test5()




© Jan Wloka 2009 All Rights reserved.                                                                                                             10
SAFE-COMMIT Example Run
   Example: Find all successfully tested changes.
                          AM:A.zap()            LC:<A, A.zap()>       CM:A.bar()            CM:A.foo()




                                        CM:A.zap           test1()          test2()               test3()



                     LC:<B, A.zap()>      CM:A.zip()                        AF:A.y                                CM:B.waff()



                                                                                   DM:B.val()                                   LC:<B, A.val()>
                                             CM:A.wiff()



                          AM:B.wiff()        LC:<A, A.wiff()>        CM:B.bla()       LC:<[B, B.val()>        CM:B.val()

                                                                                                                                CM:A.baz()
                                             LC:<B, A.wiff()>
                                                                                  test4()                   test5()




© Jan Wloka 2009 All Rights reserved.                                                                                                             10
SAFE-COMMIT Example Run
   Example: Find all successfully tested changes.
                          AM:A.zap()            LC:<A, A.zap()>       CM:A.bar()            CM:A.foo()




                                        CM:A.zap           test1()          test2()               test3()



                     LC:<B, A.zap()>      CM:A.zip()                        AF:A.y                                CM:B.waff()



                                                                                   DM:B.val()                                   LC:<B, A.val()>
                                             CM:A.wiff()



                          AM:B.wiff()        LC:<A, A.wiff()>        CM:B.bla()       LC:<[B, B.val()>        CM:B.val()

                                                                                                                                CM:A.baz()
                                             LC:<B, A.wiff()>
                                                                                  test4()                   test5()




© Jan Wloka 2009 All Rights reserved.                                                                                                             10
SAFE-COMMIT Example Run
   Example: Find all successfully tested changes.
                          AM:A.zap()            LC:<A, A.zap()>       CM:A.bar()            CM:A.foo()




                                        CM:A.zap           test1()          test2()               test3()



                     LC:<B, A.zap()>      CM:A.zip()                        AF:A.y                                CM:B.waff()



                                                                                   DM:B.val()                                   LC:<B, A.val()>
                                             CM:A.wiff()



                          AM:B.wiff()        LC:<A, A.wiff()>        CM:B.bla()       LC:<[B, B.val()>        CM:B.val()

                                                                                                                                CM:A.baz()
                                             LC:<B, A.wiff()>
                                                                                  test4()                   test5()




© Jan Wloka 2009 All Rights reserved.                                                                                                             10
SAFE-COMMIT Example Run
   Example: Find all successfully tested changes.
                          AM:A.zap()            LC:<A, A.zap()>       CM:A.bar()            CM:A.foo()




                                        CM:A.zap           test1()          test2()               test3()



                     LC:<B, A.zap()>      CM:A.zip()                        AF:A.y                                CM:B.waff()



                                                                                   DM:B.val()                                   LC:<B, A.val()>
                                             CM:A.wiff()



                          AM:B.wiff()        LC:<A, A.wiff()>        CM:B.bla()       LC:<[B, B.val()>        CM:B.val()

                                                                                                                                CM:A.baz()
                                             LC:<B, A.wiff()>
                                                                                  test4()                   test5()




© Jan Wloka 2009 All Rights reserved.                                                                                                             10
SAFE-COMMIT Example Run
   Example: Find all successfully tested changes.
                          AM:A.zap()            LC:<A, A.zap()>       CM:A.bar()            CM:A.foo()




                                        CM:A.zap           test1()          test2()               test3()



                     LC:<B, A.zap()>      CM:A.zip()                        AF:A.y                                CM:B.waff()



                                                                                   DM:B.val()                                   LC:<B, A.val()>
                                             CM:A.wiff()



                          AM:B.wiff()        LC:<A, A.wiff()>        CM:B.bla()       LC:<[B, B.val()>        CM:B.val()

                                                                                                                                CM:A.baz()
                                             LC:<B, A.wiff()>
                                                                                  test4()                   test5()




© Jan Wloka 2009 All Rights reserved.                                                                                                             10
Modeling Commit Policies

                      RESTRICTIVE: “Covered by passing tests only”
                        Tight control of commits
                        E.g., major release is imminent
                      MODERATE: “Covered by non-worsening tests only”
                        Tested changes, that don't degrade test outcomes
                        E.g., for test-first methodologies
                      PERMISSIVE: “Not covered by a worsening test”
                        Moderate Policy + untested changes
                        E.g., for technology prototypes

© Jan Wloka 2009 All Rights reserved.                                      11
Experiments
                      Goal: Set of committable changes is significant!
                        Bi-weekly repository snapshots of Daikon
                        Six pairs with failling tests
                                        Daikon
                                           Version Avg    p1     p2     p3     p4    p5     p6
                                         Changes          1751   274    1485   614   302    6050
                                          Covered         1013    5     1225   20    130    185
                         Restrictive      Total %   4.6   6.3    1.5    1.8    1.0   16.6   0.5
                            Moderate      Total % 31.4    57.9   1.5    82.5   3.3   43.0   0.5
                        Permissive        Total % 99.5    100    99.6   100    100   100    97.4



© Jan Wloka 2009 All Rights reserved.                                                              12
Experiments
                      Goal: Set of committable changes is significant!
                        Bi-weekly repository snapshots of Daikon
                        Six pairs with failling tests
                                        Daikon
                                           Version Avg      p1     p2     p3     p4     p5     p6
                                         Changes            1751   274    1485   614    302    6050
                                          Covered           1013    5     1225   20     130    185
                                            Total %   4.6   6.3    1.5    1.8    1.0    16.6   0.5
                         Restrictive
                                        Covered % 29.4      11.0   80.0   2.1    30.0   38.5   15.1
                                            Total % 31.4    57.9   1.5    82.5   3.3    43.0   0.5
                             Moderate
                                        Covered % 82.5      100    80.0   100    100    100    15.1
                         Permissive         Total % 99.5    100    99.6   100    100    100    97.4

© Jan Wloka 2009 All Rights reserved.                                                                 12
Related Work

                      Revision Control, Software Merging
                        No indirect merge conflicts, manual resolution
                        SAFE-COMMIT semantic detection w/ behavior in tests
                      Workspace Awareness Tools
                        Palantír, Hipicat, Jazz detect conflicts or similarities
                        SAFE-COMMIT prevents premature change releases
                      Continuous Integration
                        Automatic builds w/ testing to detect conflicts early
                        SAFE-COMMIT enables partial but safe commits

© Jan Wloka 2009 All Rights reserved.                                             13
Conclusions and Future Work

                      SAFE-COMMIT can reduce risk of duplicative work and
                      merge conflicts:
                        Compute safely committable changes
                        Policies of varying strictness using test outcomes
                        Commit policies can be enforced automatically
                        Experiments committed significant #changes
                      Future directions
                         Change-centric test development/generation
                         Automated resolution of merge conflicts

© Jan Wloka 2009 All Rights reserved.                                        14

More Related Content

Viewers also liked

Personalising Your Internet V2
Personalising Your Internet V2Personalising Your Internet V2
Personalising Your Internet V2
Peng Hui Lee
 
Super Over Presentation
Super Over PresentationSuper Over Presentation
Super Over Presentation
Muhammad Raza
 
Effectively Automate and Enforce Process Rules and Tasks when Delivering Changes
Effectively Automate and Enforce Process Rules and Tasks when Delivering ChangesEffectively Automate and Enforce Process Rules and Tasks when Delivering Changes
Effectively Automate and Enforce Process Rules and Tasks when Delivering Changes
Jan Wloka
 
PERSONALITY DEVELOPMENT
PERSONALITY DEVELOPMENTPERSONALITY DEVELOPMENT
PERSONALITY DEVELOPMENTvshalini
 
Test-driven Development with AEM
Test-driven Development with AEMTest-driven Development with AEM
Test-driven Development with AEM
Jan Wloka
 
Introduction To Reference Final Project
Introduction To Reference   Final ProjectIntroduction To Reference   Final Project
Introduction To Reference Final Projectwit10born
 
Colonography Gp Talk 2 Sept 2008
Colonography Gp Talk 2 Sept 2008Colonography Gp Talk 2 Sept 2008
Colonography Gp Talk 2 Sept 2008
Peng Hui Lee
 
Outcome of imaging investigations in patients with iron deficiency anaemia
Outcome of imaging investigations in patients with iron deficiency anaemiaOutcome of imaging investigations in patients with iron deficiency anaemia
Outcome of imaging investigations in patients with iron deficiency anaemia
Peng Hui Lee
 

Viewers also liked (8)

Personalising Your Internet V2
Personalising Your Internet V2Personalising Your Internet V2
Personalising Your Internet V2
 
Super Over Presentation
Super Over PresentationSuper Over Presentation
Super Over Presentation
 
Effectively Automate and Enforce Process Rules and Tasks when Delivering Changes
Effectively Automate and Enforce Process Rules and Tasks when Delivering ChangesEffectively Automate and Enforce Process Rules and Tasks when Delivering Changes
Effectively Automate and Enforce Process Rules and Tasks when Delivering Changes
 
PERSONALITY DEVELOPMENT
PERSONALITY DEVELOPMENTPERSONALITY DEVELOPMENT
PERSONALITY DEVELOPMENT
 
Test-driven Development with AEM
Test-driven Development with AEMTest-driven Development with AEM
Test-driven Development with AEM
 
Introduction To Reference Final Project
Introduction To Reference   Final ProjectIntroduction To Reference   Final Project
Introduction To Reference Final Project
 
Colonography Gp Talk 2 Sept 2008
Colonography Gp Talk 2 Sept 2008Colonography Gp Talk 2 Sept 2008
Colonography Gp Talk 2 Sept 2008
 
Outcome of imaging investigations in patients with iron deficiency anaemia
Outcome of imaging investigations in patients with iron deficiency anaemiaOutcome of imaging investigations in patients with iron deficiency anaemia
Outcome of imaging investigations in patients with iron deficiency anaemia
 

Similar to Safe-Commit Analysis to Facilitate Team Software Development

Mutation testing
Mutation testingMutation testing
Mutation testing
기영 이
 
Unit Testing with JUnit4 by Ravikiran Janardhana
Unit Testing with JUnit4 by Ravikiran JanardhanaUnit Testing with JUnit4 by Ravikiran Janardhana
Unit Testing with JUnit4 by Ravikiran Janardhana
Ravikiran J
 
White Box Testing (Introduction to)
White Box Testing (Introduction to)White Box Testing (Introduction to)
White Box Testing (Introduction to)
Henry Muccini
 
Example First / A Sane Test-Driven Approach to Programming
Example First / A Sane Test-Driven Approach to ProgrammingExample First / A Sane Test-Driven Approach to Programming
Example First / A Sane Test-Driven Approach to Programming
Jonathan Acker
 
An introduction to mutation testing
An introduction to mutation testingAn introduction to mutation testing
An introduction to mutation testingdavidmus
 
Junit 4.0
Junit 4.0Junit 4.0
Junit Recipes - Elementary tests (2/2)
Junit Recipes - Elementary tests (2/2)Junit Recipes - Elementary tests (2/2)
Junit Recipes - Elementary tests (2/2)Will Shen
 
sample_midterm.pdf
sample_midterm.pdfsample_midterm.pdf
sample_midterm.pdf
EFRENlazarte2
 
White Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR ChandigarhWhite Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR Chandigarh
Pankaj Thakur
 
Формальная верификация как средство тестирования (в Java)
Формальная верификация как средство тестирования (в Java)Формальная верификация как средство тестирования (в Java)
Формальная верификация как средство тестирования (в Java)
SQALab
 
Introduction to JUnit
Introduction to JUnitIntroduction to JUnit
Introduction to JUnit
Devvrat Shukla
 
Unit testing 101
Unit testing 101Unit testing 101
Unit testing 101
Erkin Ünlü
 
QM-013-DOE Introduction
QM-013-DOE IntroductionQM-013-DOE Introduction
QM-013-DOE Introductionhandbook
 
J unit스터디슬라이드
J unit스터디슬라이드J unit스터디슬라이드
J unit스터디슬라이드ksain
 
An introduction to Google test framework
An introduction to Google test frameworkAn introduction to Google test framework
An introduction to Google test framework
Abner Chih Yi Huang
 
TestNG vs Junit
TestNG vs JunitTestNG vs Junit
TestNG vs Junit
Büşra İçöz
 
Introduction to Julia
Introduction to JuliaIntroduction to Julia
Introduction to Julia
岳華 杜
 
System Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancementsSystem Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancementsSubash John
 
Test-Driven Development for TYPO3
Test-Driven Development for TYPO3Test-Driven Development for TYPO3
Test-Driven Development for TYPO3Oliver Klee
 

Similar to Safe-Commit Analysis to Facilitate Team Software Development (20)

Mutation testing
Mutation testingMutation testing
Mutation testing
 
Unit Testing with JUnit4 by Ravikiran Janardhana
Unit Testing with JUnit4 by Ravikiran JanardhanaUnit Testing with JUnit4 by Ravikiran Janardhana
Unit Testing with JUnit4 by Ravikiran Janardhana
 
White Box Testing (Introduction to)
White Box Testing (Introduction to)White Box Testing (Introduction to)
White Box Testing (Introduction to)
 
Example First / A Sane Test-Driven Approach to Programming
Example First / A Sane Test-Driven Approach to ProgrammingExample First / A Sane Test-Driven Approach to Programming
Example First / A Sane Test-Driven Approach to Programming
 
An introduction to mutation testing
An introduction to mutation testingAn introduction to mutation testing
An introduction to mutation testing
 
Junit 4.0
Junit 4.0Junit 4.0
Junit 4.0
 
Junit Recipes - Elementary tests (2/2)
Junit Recipes - Elementary tests (2/2)Junit Recipes - Elementary tests (2/2)
Junit Recipes - Elementary tests (2/2)
 
sample_midterm.pdf
sample_midterm.pdfsample_midterm.pdf
sample_midterm.pdf
 
White Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR ChandigarhWhite Box testing by Pankaj Thakur, NITTTR Chandigarh
White Box testing by Pankaj Thakur, NITTTR Chandigarh
 
Формальная верификация как средство тестирования (в Java)
Формальная верификация как средство тестирования (в Java)Формальная верификация как средство тестирования (в Java)
Формальная верификация как средство тестирования (в Java)
 
Introduction to JUnit
Introduction to JUnitIntroduction to JUnit
Introduction to JUnit
 
Unit testing 101
Unit testing 101Unit testing 101
Unit testing 101
 
QM-013-DOE Introduction
QM-013-DOE IntroductionQM-013-DOE Introduction
QM-013-DOE Introduction
 
J unit스터디슬라이드
J unit스터디슬라이드J unit스터디슬라이드
J unit스터디슬라이드
 
JUnit
JUnitJUnit
JUnit
 
An introduction to Google test framework
An introduction to Google test frameworkAn introduction to Google test framework
An introduction to Google test framework
 
TestNG vs Junit
TestNG vs JunitTestNG vs Junit
TestNG vs Junit
 
Introduction to Julia
Introduction to JuliaIntroduction to Julia
Introduction to Julia
 
System Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancementsSystem Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancements
 
Test-Driven Development for TYPO3
Test-Driven Development for TYPO3Test-Driven Development for TYPO3
Test-Driven Development for TYPO3
 

Recently uploaded

RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
Jen Stirrup
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 

Recently uploaded (20)

RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...The Metaverse and AI: how can decision-makers harness the Metaverse for their...
The Metaverse and AI: how can decision-makers harness the Metaverse for their...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 

Safe-Commit Analysis to Facilitate Team Software Development

  • 1. SAFE-COMMIT Analysis to Facilitate Team Software Development Jan Wloka PROLANGS Rutgers University Barbara G. Ryder Frank Tip Xiaoxia Ren Virginia Tech IBM Research Rutgers University © Jan Wloka 2009 All Rights reserved.
  • 2. Parallel Work on Shared Code Problems: Merge conflicts, duplicative work Revision control systems (RCS) detect quot;directquot; merge conflicts Commit policy governs commit process “Commit early and commit often.” “Don’t commit compilation or test failures.” © Jan Wloka 2009 All Rights reserved. 2
  • 3. Parallel Work on Shared Code Problems: Merge conflicts, duplicative work Revision control systems (RCS) detect quot;directquot; merge conflicts Commit policy governs commit process “Commit early and commit often.” “Don’t commit compilation or test failures.” Problems are still not solved! RCS offer limited conflict detection/resolution Policies are not enforced Policies may be too restrictive © Jan Wloka 2009 All Rights reserved. 2
  • 4. Enforceable SAFE-COMMIT Policies Idea: Observe effects on test results to detect unsafe changes, e.g.: Changes affect a failing test Changes affect a worsening test Changes not tested © Jan Wloka 2009 All Rights reserved. 3
  • 5. Enforceable SAFE-COMMIT Policies Idea: Observe effects on test results to detect unsafe changes, e.g.: Changes affect a failing test Changes affect a worsening test Changes not tested Policies of varying degrees of strictness (intuition) Commit changes that affect only passing tests Commit changes that affect only non-worsening tests Commit changes that don’t degrade test outcomes © Jan Wloka 2009 All Rights reserved. 3
  • 6. Change Models [PASTE’01, OOPSLA’04, ICSE’05, TSE’06, ICSE’09] Decompose an edit into 19 distinct atomic changes Reflecting language semantics Are atomic Potential change in dispatch behavior Lookup change: explicit effect on a dispatch entry Inter-dependences between changes Syntactic, structural requirements Cause – effect mapping © Jan Wloka 2009 All Rights reserved. 4
  • 7. Explicit Representation of Change class A { public class Tests extends TestCase { Test int y; public void test1() { int zip(int x) { A a = new A(); this.y = x; a.bar(3); test x = zap(x); assertEquals(5, a.zip(3)); test return x + 2; } public void test2() { test } A a = new A(); int zap(int x) { return 2 * x; } test int temp = a.bar(2); int foo(int x) { return 2 * x; } assertEquals(2, a.foo(temp)); test int bar(int x) { return x / 2 ; } } int wiff(int x) { return x; } public void test3() { int baz(int x) { return x + 1; } B b = new B(); int val() { return 2; } assertEquals(5, b.waff(5)); } } class B extends A { public void test4() { int waff(int x) { this.y = x; return x; } B b = new B(); int bla(int x) { return 7 + this.val(); } assertEquals(8, b.bla(5)); int val() { return 1; } } public void test5() { } A a = new B(); assertEquals(a.baz(1), a.val()); } © Jan Wloka 2009 All Rights reserved. } 5
  • 8. Explicit Representation of Change Class class A { A public class Tests extends TestCase { Test Method void test1() Method public Method { Method int y; foo(int) = new A(); A a bar(int) wiff(int) baz(int) int zip(int x) { this.y = x; a.bar(3); test x = zap(x); assertEquals(5, a.zip(3)); test return x + 2; } public void test2() { test } A a = new A(); int zap(int x) { return 2 * x; } test Field tempMethod int = a.bar(2); Method Method int foo(int x) { return 2 * x; } assertEquals(2, a.foo(temp)); val() y zip(int) zap() test int bar(int x) { return x / 2 ; } } int wiff(int x) { return x; } public void test3() { int baz(int x) { return x + 1; } Class B b = new B(); int val() { return 2; } B assertEquals(5, b.waff(5)); } } class B extends A { Method void test4() Method public Method { int waff(int x) { this.y = x; return x; } waff(int) = new B(); B b bla(int) val() int bla(int x) { return 7 + this.val(); } assertEquals(8, b.bla(5)); int val() { return 1; } } public void test5() { } A a = new B(); assertEquals(a.baz(1), a.val()); } © Jan Wloka 2009 All Rights reserved. } 5
  • 9. Explicit Representation of Change Class class A { A public class Tests extends TestCase { Test Method void test1() Method public Method { Method int y; foo(int) = new A(); A a bar(int) wiff(int) baz(int) int zip(int x) { this.y = x; a.bar(3); AM test x = zap(x); assertEquals(5, a.zip(3)); test return x + 2; } public void test2() { test } A a = new A(); int zap(int x) { return 2 * x; } test Field tempMethod int = a.bar(2); Method Method int foo(int x) { return 2 * x; } assertEquals(2, a.foo(temp)); val() y zip(int) zap() test int bar(int x) { return x / 2 ; } } AF AM int wiff(int x) { return x; } public void test3() { int baz(int x) { return x + 1; } Class B b = new B(); int val() { return 2; } B assertEquals(5, b.waff(5)); } } class B extends A { Method void test4() Method public Method { int waff(int x) { this.y = x; return x; } waff(int) = new B(); B b bla(int) val() int bla(int x) { return 7 + this.val(); } assertEquals(8, b.bla(5)); DM int val() { return 1; } } public void test5() { } A a = new B(); assertEquals(a.baz(1), a.val()); } © Jan Wloka 2009 All Rights reserved. } 5
  • 10. Explicit Representation of Change Class class A { A public class Tests extends TestCase { Test Method void test1() Method public Method { Method int y; foo(int) = new A(); A a bar(int) wiff(int) baz(int) int zip(int x) { CM a.bar(3); CM AM CM test this.y = x; CM assertEquals(5, a.zip(3)); x = zap(x); test return x + 2; } public void test2() { test } A a = new A(); int zap(int x) { return 2 * x; } test Field tempMethod int = a.bar(2); Method Method int foo(int x) { return 2 * x; } assertEquals(2, a.foo(temp)); val() y zip(int) zap() test int bar(int x) { return x / 2 ; } } AF CM AM int wiff(int x) { return x; } public void test3() CM { int baz(int x) { return x + 1; } Class B b = new B(); int val() { return 2; } B assertEquals(5, b.waff(5)); } } class B extends A { Method void test4() Method public Method { int waff(int x) { this.y = x; return x; } waff(int) = new B(); B b bla(int) val() int bla(int x) { return 7 + this.val(); } CM assertEquals(8, b.bla(5)); CM DM int val() { return 1; } } CM public void test5() { } A a = new B(); assertEquals(a.baz(1), a.val()); } © Jan Wloka 2009 All Rights reserved. } 5
  • 11. Explicit Representation of Change Class class A { A public class Tests extends TestCase { Test Method void test1() Method public Method { Method int y; foo(int) = new A(); A a bar(int) wiff(int) baz(int) int zip(int x) { CM a.bar(3); CM AM CM test this.y = x; CM assertEquals(5, a.zip(3)); x = zap(x); test return x + 2; } public void test2() { test } A a = new A(); int zap(int x) { return 2 * x; } test Field tempMethod int = a.bar(2); Method Method int foo(int x) { return 2 * x; } assertEquals(2, a.foo(temp)); val() y zip(int) zap() test int bar(int x) { return x / 2 ; } } AF CM AM int wiff(int x) { return x; } public void test3() CM { int baz(int x) { return x + 1; } Class B b = new B(); int val() { return 2; } B assertEquals(5, b.waff(5)); } } class B extends A { Method void test4() Method public Method { int waff(int x) { this.y = x; return x; } waff(int) = new B(); B b bla(int) val() int bla(int x) { return 7 + this.val(); } CM assertEquals(8, b.bla(5)); CM DM int val() { return 1; } } CM public void test5() { } A a = new B(); assertEquals(a.baz(1), a.val()); } © Jan Wloka 2009 All Rights reserved. } 5
  • 12. Explicit Representation of Change Class class A { A public class Tests extends TestCase { Test Method void test1() Method public Method { Method int y; foo(int) = new A(); A a bar(int) wiff(int) baz(int) int zip(int x) { CM a.bar(3); CM AM CM test this.y = x; CM assertEquals(5, a.zip(3)); x = zap(x); test } LC return x + 2; public void test2() { LC test } A a = new A(); int zap(int x) { return 2 * x; } test Field tempMethod int = a.bar(2); Method Method int foo(int x) { return 2 * x; } assertEquals(2, a.foo(temp)); val() y zip(int) zap() test int bar(int x) { return x / 2 ; } } AF CM AM LC int wiff(int x) { return x; } public void test3() CM { int baz(int x) { return x + 1; } Class B b = new B(); B LC int val() { return 2; } assertEquals(5, b.waff(5)); LC } } class B extends A { Method void test4() Method public Method { int waff(int x) { this.y = x; return x; } waff(int) = new B(); B b bla(int) val() int bla(int x) { return 7 + this.val(); } CM assertEquals(8, b.bla(5)); CM DM int val() { return 1; } } CM public void test5() { } LC A a = new B(); assertEquals(a.baz(1), a.val()); } © Jan Wloka 2009 All Rights reserved. } 5
  • 13. Determining Effects on Program Behavior Program Source Code Atomic Change Model Program Behavior AST :: original P I C M M AST :: edited P I C C M M M M © Jan Wloka 2009 All Rights reserved. 6
  • 14. Determining Effects on Program Behavior Program Source Code Atomic Change Model Program Behavior AST :: original P I C C M M M M AST :: edited P I C C M M M M © Jan Wloka 2009 All Rights reserved. 6
  • 15. Determining Effects on Program Behavior Program Source Code Atomic Change Model Program Behavior AST :: original P I C AC C M M AM AM M M AST :: edited P CM CM I C C M M M M © Jan Wloka 2009 All Rights reserved. 6
  • 16. Determining Effects on Program Behavior Program Source Code Atomic Change Model Program Behavior AST :: original LC P LC I C AC C M M LC AM AM M M AST :: edited P CM CM I C C M M M M © Jan Wloka 2009 All Rights reserved. 6
  • 17. Determining Effects on Program Behavior Program Source Code Atomic Change Model Program Behavior AST :: original LC call graph :: test1 P LC I C AC C M M LC AM AM call graph :: test2 M M AST :: edited P CM CM I C C M M M M © Jan Wloka 2009 All Rights reserved. 6
  • 18. Determining Effects on Program Behavior Program Source Code Atomic Change Model Program Behavior AST :: original LC call graph :: test1 P LC I C AC C M M LC AM AM call graph :: test2 M M AST :: edited P CM CM I C C M M M M © Jan Wloka 2009 All Rights reserved. 6
  • 19. Determining Effects on Program Behavior Program Source Code Atomic Change Model Program Behavior AST :: original LC call graph :: test1 P LC I C AC C M M LC AM AM call graph :: test2 M M AST :: edited P CM CM I C C M M M M © Jan Wloka 2009 All Rights reserved. 6
  • 20. Determining Effects on Program Behavior Program Source Code Atomic Change Model Program Behavior AST :: original LC call graph :: test1 P LC I C AC C M M LC AM AM call graph :: test2 M M AST :: edited P CM CM I C C M M M M © Jan Wloka 2009 All Rights reserved. 6
  • 21. Determining Effects on Program Behavior Program Source Code Atomic Change Model Program Behavior AST :: original LC call graph :: test1 P LC I C AC C M M LC AM AM call graph :: test2 M M AST :: edited P CM CM I C C M M M M © Jan Wloka 2009 All Rights reserved. 6
  • 22. Determining Effects on Program Behavior Program Source Code Atomic Change Model Program Behavior AST :: original LC call graph :: test1 P LC I C AC C M M LC AM AM call graph :: test2 M M AST :: edited P CM CM I C C M M M M © Jan Wloka 2009 All Rights reserved. 6
  • 23. Classifications of Unsafe Changes Definition Change Coverage: A change c is covered by a test t if (i) c is exercised by t (ii) c depends on c′, c′ is covered by t, or (iii) c′ depends on c , c′ is covered by t. © Jan Wloka 2009 All Rights reserved. 7
  • 24. Classifications of Unsafe Changes Definition Change Coverage: A change c is covered by a test t if (i) c is exercised by t (ii) c depends on c′, c′ is covered by t, or Test Outcomes pass → pass (iii) c′ depends on c , c′ is covered by t. fail → pass Classification of test outcomes pass → fail fail → fail Passing: {p→p, f→p, ∅→p} ∅ → pass Not worsening: Passing + {f→f, ∅→f} ∅ → fail pass → ∅ Worsening: {p→f} fail → ∅ © Jan Wloka 2009 All Rights reserved. 7
  • 25. Classifications of Unsafe Changes Definition Change Coverage: A change c is covered by a test t if (i) c is exercised by t (ii) c depends on c′, c′ is covered by t, or Test Outcomes pass → pass (iii) c′ depends on c , c′ is covered by t. fail → pass Classification of test outcomes pass → fail fail → fail Passing: {p→p, f→p, ∅→p} ∅ → pass Not worsening: Passing + {f→f, ∅→f} ∅ → fail pass → ∅ Worsening: {p→f} fail → ∅ ➾ E.g, c is unsafe, because it’s covered by a worsening test. © Jan Wloka 2009 All Rights reserved. 7
  • 26. Preserving Test Behavior public class Tests extends TestCase { public void test1() { A a = new A(); a.bar(3); assertEquals(5, a.zip(3)); } public void test2() { /* ... */ } public void test3() { /* ... */ } public void test4() { /* ... */ } public void test5() { /* ... */ } } { Test Results original edited test1 ! quot; test2 ! ! test3 ! ! test4 ! quot; test5 ! ! © Jan Wloka 2009 All Rights reserved. 8
  • 27. Preserving Test Behavior public class Tests extends TestCase { public void test1() { A a = new A(); a.bar(3); assertEquals(5, a.zip(3)); Tests.test1() } <A,A.bar()> <A,A.zip()> public void test2() { /* ... */ } public void test3() { /* ... */ } A.A() A.bar() A.zip() Assert.assertEquals() public void test4() { /* ... */ } public void test5() { /* ... */ } } <A,A.zap()> { Test Results A.zap() original edited test1 ! quot; test2 ! ! test3 ! ! test4 ! quot; test5 ! ! © Jan Wloka 2009 All Rights reserved. 8
  • 28. Preserving Test Behavior public class Tests extends TestCase { public void test1() { A a = new A(); a.bar(3); assertEquals(5, a.zip(3)); Tests.test1() } <A,A.bar()> <A,A.zip()> public void test2() { /* ... */ } public void test3() { /* ... */ } A.A() A.bar() A.zip() Assert.assertEquals() public void test4() { /* ... */ } public void test5() { /* ... */ } CM1 CM2 } <A,A.zap()> { Test Results A.zap() CM:B.waff() AF:A.y original edited CM3 LC1 test1 ! quot; LC2:<B,A.zap()> AM1:A.zap() test2 ! ! test3 ! ! test4 ! quot; test5 ! ! © Jan Wloka 2009 All Rights reserved. 8
  • 29. Preserving Test Behavior public class Tests extends TestCase { public void test1() { A a = new A(); a.bar(3); assertEquals(5, a.zip(3)); Tests.test1() } <A,A.bar()> <A,A.zip()> public void test2() { /* ... */ } public void test3() { /* ... */ } A.A() A.bar() A.zip() Assert.assertEquals() public void test4() { /* ... */ } public void test5() { /* ... */ } CM1 CM2 } <A,A.zap()> { Test Results A.zap() CM:B.waff() AF:A.y original edited CM3 LC1 test1 ! quot; LC2:<B,A.zap()> AM1:A.zap() test2 ! ! test3 ! ! test4 ! quot; test5 ! ! © Jan Wloka 2009 All Rights reserved. 8
  • 30. Preserving Test Behavior public class Tests extends TestCase { public void test1() { A a = new A(); a.bar(3); assertEquals(5, a.zip(3)); Tests.test1() } <A,A.bar()> <A,A.zip()> public void test2() { /* ... */ } public void test3() { /* ... */ } A.A() A.bar() A.zip() Assert.assertEquals() public void test4() { /* ... */ } public void test5() { /* ... */ } CM1 CM2 } <A,A.zap()> { Test Results A.zap() CM:B.waff() AF:A.y original edited CM3 LC1 test1 ! quot; LC2:<B,A.zap()> AM1:A.zap() test2 ! ! test3 ! ! test4 ! quot; test5 ! ! © Jan Wloka 2009 All Rights reserved. 8
  • 31. Preserving Test Behavior public class Tests extends TestCase { public void test1() { A a = new A(); a.bar(3); assertEquals(5, a.zip(3)); Tests.test1() } <A,A.bar()> <A,A.zip()> public void test2() { /* ... */ } public void test3() { /* ... */ } A.A() A.bar() A.zip() Assert.assertEquals() public void test4() { /* ... */ } public void test5() { /* ... */ } CM1 CM2 } <A,A.zap()> { Test Results A.zap() CM:B.waff() AF:A.y original edited CM3 LC1 test1 ! quot; LC2:<B,A.zap()> AM1:A.zap() test2 ! ! test3 ! ! test4 ! quot; {CM1, CM2, CM3, LC1, LC2, AM1} test5 ! ! may affect a worsening test. © Jan Wloka 2009 All Rights reserved. 8
  • 32. SAFE-COMMIT Algorithm Sk etch Input: CHANGES, EXERCISED(t), COVERED(t), INPUTTESTS Add INPUTTESTS to set PRESERVEDTESTS Step1: Selection of NONCOMMITTABLE Find changes in EXERCISED(t) Find changes in DEPENDENCES(c) Step2: Selection of new PRESERVEDTESTS Find tests t : COVERED(t) contains c in NONCOMMITTABLE COMMITTABLE= CHANGES (NONCOMMITTABLE ∪ UNCOVERED) Output: COMMITTABLE, PRESERVEDTESTS © Jan Wloka 2009 All Rights reserved. 9
  • 33. SAFE-COMMIT Example Run Example: Find all successfully tested changes. AM:A.zap() LC:<A, A.zap()> CM:A.bar() CM:A.foo() CM:A.zap test1() test2() test3() LC:<B, A.zap()> CM:A.zip() AF:A.y CM:B.waff() DM:B.val() LC:<B, A.val()> CM:A.wiff() AM:B.wiff() LC:<A, A.wiff()> CM:B.bla() LC:<[B, B.val()> CM:B.val() CM:A.baz() LC:<B, A.wiff()> test4() test5() © Jan Wloka 2009 All Rights reserved. 10
  • 34. SAFE-COMMIT Example Run Example: Find all successfully tested changes. AM:A.zap() LC:<A, A.zap()> CM:A.bar() CM:A.foo() CM:A.zap test1() test2() test3() LC:<B, A.zap()> CM:A.zip() AF:A.y CM:B.waff() DM:B.val() LC:<B, A.val()> CM:A.wiff() AM:B.wiff() LC:<A, A.wiff()> CM:B.bla() LC:<[B, B.val()> CM:B.val() CM:A.baz() LC:<B, A.wiff()> test4() test5() © Jan Wloka 2009 All Rights reserved. 10
  • 35. SAFE-COMMIT Example Run Example: Find all successfully tested changes. AM:A.zap() LC:<A, A.zap()> CM:A.bar() CM:A.foo() CM:A.zap test1() test2() test3() LC:<B, A.zap()> CM:A.zip() AF:A.y CM:B.waff() DM:B.val() LC:<B, A.val()> CM:A.wiff() AM:B.wiff() LC:<A, A.wiff()> CM:B.bla() LC:<[B, B.val()> CM:B.val() CM:A.baz() LC:<B, A.wiff()> test4() test5() © Jan Wloka 2009 All Rights reserved. 10
  • 36. SAFE-COMMIT Example Run Example: Find all successfully tested changes. AM:A.zap() LC:<A, A.zap()> CM:A.bar() CM:A.foo() CM:A.zap test1() test2() test3() LC:<B, A.zap()> CM:A.zip() AF:A.y CM:B.waff() DM:B.val() LC:<B, A.val()> CM:A.wiff() AM:B.wiff() LC:<A, A.wiff()> CM:B.bla() LC:<[B, B.val()> CM:B.val() CM:A.baz() LC:<B, A.wiff()> test4() test5() © Jan Wloka 2009 All Rights reserved. 10
  • 37. SAFE-COMMIT Example Run Example: Find all successfully tested changes. AM:A.zap() LC:<A, A.zap()> CM:A.bar() CM:A.foo() CM:A.zap test1() test2() test3() LC:<B, A.zap()> CM:A.zip() AF:A.y CM:B.waff() DM:B.val() LC:<B, A.val()> CM:A.wiff() AM:B.wiff() LC:<A, A.wiff()> CM:B.bla() LC:<[B, B.val()> CM:B.val() CM:A.baz() LC:<B, A.wiff()> test4() test5() © Jan Wloka 2009 All Rights reserved. 10
  • 38. SAFE-COMMIT Example Run Example: Find all successfully tested changes. AM:A.zap() LC:<A, A.zap()> CM:A.bar() CM:A.foo() CM:A.zap test1() test2() test3() LC:<B, A.zap()> CM:A.zip() AF:A.y CM:B.waff() DM:B.val() LC:<B, A.val()> CM:A.wiff() AM:B.wiff() LC:<A, A.wiff()> CM:B.bla() LC:<[B, B.val()> CM:B.val() CM:A.baz() LC:<B, A.wiff()> test4() test5() © Jan Wloka 2009 All Rights reserved. 10
  • 39. SAFE-COMMIT Example Run Example: Find all successfully tested changes. AM:A.zap() LC:<A, A.zap()> CM:A.bar() CM:A.foo() CM:A.zap test1() test2() test3() LC:<B, A.zap()> CM:A.zip() AF:A.y CM:B.waff() DM:B.val() LC:<B, A.val()> CM:A.wiff() AM:B.wiff() LC:<A, A.wiff()> CM:B.bla() LC:<[B, B.val()> CM:B.val() CM:A.baz() LC:<B, A.wiff()> test4() test5() © Jan Wloka 2009 All Rights reserved. 10
  • 40. SAFE-COMMIT Example Run Example: Find all successfully tested changes. AM:A.zap() LC:<A, A.zap()> CM:A.bar() CM:A.foo() CM:A.zap test1() test2() test3() LC:<B, A.zap()> CM:A.zip() AF:A.y CM:B.waff() DM:B.val() LC:<B, A.val()> CM:A.wiff() AM:B.wiff() LC:<A, A.wiff()> CM:B.bla() LC:<[B, B.val()> CM:B.val() CM:A.baz() LC:<B, A.wiff()> test4() test5() © Jan Wloka 2009 All Rights reserved. 10
  • 41. SAFE-COMMIT Example Run Example: Find all successfully tested changes. AM:A.zap() LC:<A, A.zap()> CM:A.bar() CM:A.foo() CM:A.zap test1() test2() test3() LC:<B, A.zap()> CM:A.zip() AF:A.y CM:B.waff() DM:B.val() LC:<B, A.val()> CM:A.wiff() AM:B.wiff() LC:<A, A.wiff()> CM:B.bla() LC:<[B, B.val()> CM:B.val() CM:A.baz() LC:<B, A.wiff()> test4() test5() © Jan Wloka 2009 All Rights reserved. 10
  • 42. SAFE-COMMIT Example Run Example: Find all successfully tested changes. AM:A.zap() LC:<A, A.zap()> CM:A.bar() CM:A.foo() CM:A.zap test1() test2() test3() LC:<B, A.zap()> CM:A.zip() AF:A.y CM:B.waff() DM:B.val() LC:<B, A.val()> CM:A.wiff() AM:B.wiff() LC:<A, A.wiff()> CM:B.bla() LC:<[B, B.val()> CM:B.val() CM:A.baz() LC:<B, A.wiff()> test4() test5() © Jan Wloka 2009 All Rights reserved. 10
  • 43. SAFE-COMMIT Example Run Example: Find all successfully tested changes. AM:A.zap() LC:<A, A.zap()> CM:A.bar() CM:A.foo() CM:A.zap test1() test2() test3() LC:<B, A.zap()> CM:A.zip() AF:A.y CM:B.waff() DM:B.val() LC:<B, A.val()> CM:A.wiff() AM:B.wiff() LC:<A, A.wiff()> CM:B.bla() LC:<[B, B.val()> CM:B.val() CM:A.baz() LC:<B, A.wiff()> test4() test5() © Jan Wloka 2009 All Rights reserved. 10
  • 44. SAFE-COMMIT Example Run Example: Find all successfully tested changes. AM:A.zap() LC:<A, A.zap()> CM:A.bar() CM:A.foo() CM:A.zap test1() test2() test3() LC:<B, A.zap()> CM:A.zip() AF:A.y CM:B.waff() DM:B.val() LC:<B, A.val()> CM:A.wiff() AM:B.wiff() LC:<A, A.wiff()> CM:B.bla() LC:<[B, B.val()> CM:B.val() CM:A.baz() LC:<B, A.wiff()> test4() test5() © Jan Wloka 2009 All Rights reserved. 10
  • 45. Modeling Commit Policies RESTRICTIVE: “Covered by passing tests only” Tight control of commits E.g., major release is imminent MODERATE: “Covered by non-worsening tests only” Tested changes, that don't degrade test outcomes E.g., for test-first methodologies PERMISSIVE: “Not covered by a worsening test” Moderate Policy + untested changes E.g., for technology prototypes © Jan Wloka 2009 All Rights reserved. 11
  • 46. Experiments Goal: Set of committable changes is significant! Bi-weekly repository snapshots of Daikon Six pairs with failling tests Daikon Version Avg p1 p2 p3 p4 p5 p6 Changes 1751 274 1485 614 302 6050 Covered 1013 5 1225 20 130 185 Restrictive Total % 4.6 6.3 1.5 1.8 1.0 16.6 0.5 Moderate Total % 31.4 57.9 1.5 82.5 3.3 43.0 0.5 Permissive Total % 99.5 100 99.6 100 100 100 97.4 © Jan Wloka 2009 All Rights reserved. 12
  • 47. Experiments Goal: Set of committable changes is significant! Bi-weekly repository snapshots of Daikon Six pairs with failling tests Daikon Version Avg p1 p2 p3 p4 p5 p6 Changes 1751 274 1485 614 302 6050 Covered 1013 5 1225 20 130 185 Total % 4.6 6.3 1.5 1.8 1.0 16.6 0.5 Restrictive Covered % 29.4 11.0 80.0 2.1 30.0 38.5 15.1 Total % 31.4 57.9 1.5 82.5 3.3 43.0 0.5 Moderate Covered % 82.5 100 80.0 100 100 100 15.1 Permissive Total % 99.5 100 99.6 100 100 100 97.4 © Jan Wloka 2009 All Rights reserved. 12
  • 48. Related Work Revision Control, Software Merging No indirect merge conflicts, manual resolution SAFE-COMMIT semantic detection w/ behavior in tests Workspace Awareness Tools Palantír, Hipicat, Jazz detect conflicts or similarities SAFE-COMMIT prevents premature change releases Continuous Integration Automatic builds w/ testing to detect conflicts early SAFE-COMMIT enables partial but safe commits © Jan Wloka 2009 All Rights reserved. 13
  • 49. Conclusions and Future Work SAFE-COMMIT can reduce risk of duplicative work and merge conflicts: Compute safely committable changes Policies of varying strictness using test outcomes Commit policies can be enforced automatically Experiments committed significant #changes Future directions Change-centric test development/generation Automated resolution of merge conflicts © Jan Wloka 2009 All Rights reserved. 14