Verification Aided Regression Testing (VART)

  • View
    39

  • Download
    0

Embed Size (px)

DESCRIPTION

ISSTA 2014 Accepted. Verification Aided Regression Testing (VART). Antti E. J. Hyvarinen , Grigory Fedyukovich , Natasha Sharygina University of Lugano. Fabrizio Pastore , Leonardo Mariani University of Milano - Bicocca. Ali Muhammad VTT Finland. Stephan Sehestedt ABB Germany. - PowerPoint PPT Presentation

Transcript

PowerPoint Presentation

Verification AidedRegression Testing (VART)Fabrizio Pastore, Leonardo Mariani University of Milano - BicoccaAntti E. J. Hyvarinen, Grigory Fedyukovich, Natasha Sharygina University of Lugano

PINCETTEStephan SehestedtABB GermanyAli MuhammadVTT Finland

ISSTA 2014Acceptedverification aided regression testing, a technique that augment regression testing withautomated verification capabilities. 1Base ProgramUpgraded Programworkingno longer workingRegression Failures2Base ProgramUpgraded ProgramTest CaseTraditional Regression TestingTest CaseTest CaseWrite tests for BaseBase ProgramUpgraded ProgramTest CaseTraditional Regression TestingTest CaseTest CaseWrite tests for BaseRe-Executeon UpgradedExecuteBase ProgramUpgraded ProgramTest CaseTraditional Regression TestingTest CaseTest CaseWrite tests for BaseRe-Executeon UpgradedExecutePROBLEM: Base Test inputs might not trigger the regressionMonitor + InferenceBase ProgramUpgraded ProgramTest CaseTraditional Regression TestingTest CaseTest CaseExecuteProperties ModelCheckingShow PropertiesNot Validin Upgraded6int isAvailable(node* product){if ( notInitialized(product) )return 0;if ( product->items > 0 )return 1;return 0;}int isAvailable(node* product){if ( notInitialized(product) )return 0; if ( product->in_catalog == 0 )return -1;if ( product->items > 0 )return 1;return 0;}long availableProducts( t_store* store ){node* product = store->products;long total = 0;while ( product != 0 ) {total += isAvailable( product );product = product->nxt;Base VersionUpgraded Version}return total;Base Version:total >= 0Upgraded Version:total >= 0 FALSE... we want to drive properties that allow to detect the presence of a bug, so the first step we do is to monitor the softwrae and derive the properties

fault not revealed by tests7Dynamic Properties for BaseBase ProgramUpgraded ProgramTests for BaseMonitoring + Inference8int isAvailable(node* product){if ( notInitialized (product) )return 0;if ( product->items > 0 )return 1;return 0;}long availableProducts( t_store* store ){node* product = store->products;long total = 0;

while ( product != 0 ) {total += isAvailable( product );product = product->nxt;}return total;}1011121314151617181920212223242526VART monitors the functions that are more likely impatced by the change, the modified function, its callers and its callees9AcerAspireMacBookAirDell1011121314151617181920212223242526total012return01113return3int isAvailable(node* product){if ( notInitialized (product) )return 0;if ( product->items > 0 )return 1;return 0;}long availableProducts( t_store* store ){node* product = store->products;long total = 0;

while ( product != 0 ) {total += isAvailable( product );product = product->nxt;}return total;}product.items0325product.nameMacBookProproduct.items0325The result of the monitoring is to have the concrete data observed at runtime for the variables in the scope of the monitored program points10AcerAspireMacBookAirDell1011121314151617181920212223242526total012return01113return3int isAvailable(node* product){if ( notInitialized (product) )return 0;if ( product->items > 0 )return 1;return 0;}long availableProducts( t_store* store ){node* product = store->products;long total = 0;

while ( product != 0 ) {total += isAvailable( product );product = product->nxt;}return total;}product.items0325product.nameMacBookProproduct.items0325The result of the monitoring is to have the concrete data observed at runtime for the variables in the scope of the monitored program points11AcerAspireMacBookAirDell1011121314151617181920212223242526total012return01113return3int isAvailable(node* product){if ( notInitialized (product) )return 0;if ( product->items > 0 )return 1;return 0;}long availableProducts( t_store* store ){node* product = store->products;long total = 0;

while ( product != 0 ) {total += isAvailable( product );product = product->nxt;}return total;}product.items0325product.nameMacBookProproduct.items0325Inference with Daikon [Ernst et al.]The result of the monitoring is to have the concrete data observed at runtime for the variables in the scope of the monitored program points12AcerAspireMacBookAirDell1011121314151617181920212223242526total012return01113return3int isAvailable(node* product){if ( notInitialized (product) )return 0;if ( product->items > 0 )return 1;return 0;}long availableProducts( t_store* store ){node* product = store->products;long total = 0;

while ( product != 0 ) {total += isAvailable( product );product = product->nxt;}return total;}product.items >= 0product.nameMacBookProproduct.items0325Inference with Daikon [Ernst et al.]The result of the monitoring is to have the concrete data observed at runtime for the variables in the scope of the monitored program points131011121314151617181920212223242526total012return one of {0,1}3return3int isAvailable(node* product){if ( notInitialized (product) )return 0;if ( product->items > 0 )return 1;return 0;}long availableProducts( t_store* store ){node* product = store->products;long total = 0;

while ( product != 0 ) {total += isAvailable( product );product = product->nxt;}return total;}product.items >= 0product.items0325Inference with Daikon [Ernst et al.]AcerAspireMacBookAirDellproduct.nameMacBookProThe result of the monitoring is to have the concrete data observed at runtime for the variables in the scope of the monitored program points14AcerAspireMacBookAirDell1011121314151617181920212223242526total >= 0return one of {0,1}return3int isAvailable(node* product){if ( notInitialized (product) )return 0;if ( product->items > 0 )return 1;return 0;}long availableProducts( t_store* store ){node* product = store->products;long total = 0;

while ( product != 0 ) {total += isAvailable( product );product = product->nxt;}return total;}product.items >= 0product.nameMacBookProproduct.items0325Inference with Daikon [Ernst et al.]The result of the monitoring is to have the concrete data observed at runtime for the variables in the scope of the monitored program points151011121314151617181920212223242526total >= 0return one of {0,1}return one of {0,3}int isAvailable(node* product){if ( notInitialized (product) )return 0;if ( product->items > 0 )return 1;return 0;}long availableProducts( t_store* store ){node* product = store->products;long total = 0;

while ( product != 0 ) {total += isAvailable( product );product = product->nxt;}return total;}product.items >= 0product.items >= 0Inference with Daikon [Ernst et al.]Overfitting The result of the monitoring is to have the concrete data observed at runtime for the variables in the scope of the monitored program points16Dynamic Properties for BaseMonitoring + InferenceUpgraded ProgramTests for BaseBase ProgramVerified Properties for BaseDynamic Properties for BaseIntra-Version Property VerificationMonitoring + InferenceTests for BaseisAvailable(..)notInitialized(..)drawProductBox(..)main(..)Base ProgramavailableItems(..) { . . . while ( .. ) { .. } assert( total > 0 )Bounded Model CheckerVerified Properties for BaseDynamic Properties for BaseIntra-Version Property VerificationMonitoring + InferenceTests for BaseisAvailable(..)notInitialized(..)drawProductBox(..)main(..)Base ProgramavailableItems(..) { . . . while ( .. ) { .. } assert( total > 0 )EvolCheckfunction summariesint isAvailable(node* product){if ( notInitialized (product) )return 0;if ( product->items > 0 )return 1;return 0;}long availableProducts( t_store* store ){node* product = store->products;long total = 0;

while ( product != 0 ) {total += isAvailable( product );product = product->nxt;}return total;}1011121314151617181920212223242526total >= 0return one of {0,1}return one of {2, 3}product.items >= 0int isAvailable(node* product){ assert( product->items >= 0 )if ( notInitialized (product) )return 0;if ( product->items > 0 )return 1;return 0;}long availableProducts( t_store* store ){node* product = store->products;long total = 0;

while ( product != 0 ) {total += isAvailable( product );product = product->nxt;}return total;}17181920212223242526total >= 0return one of {0,1}return one of {2, 3}10

111213141516long availableProducts( t_store* store ){node* product = store->products;long total = 0;

while ( product != 0 ) {total += isAvailable( product );product = product->nxt;}return total;}17181920212223242526total >= 0return one of {2, 3}int isAvailable(node* product){ assert( product->items >= 0 )if ( notInitialized (product) ){ int ret_0=0; assert(ret_0 == 0 || ret_0 == 1); return ret_0; }if ( product->items > 0 ){ int ret_1=0; assert(ret_1 == 0 || ret_0 == 1); return ret_1; }int ret_2=0; assert(ret_2 == 0 || ret_2 == 1); return ret_2;}10

111213141516long availableProducts( t_store* store ){node* product = store->products;long total = 0;

while ( product != 0 ) {total += isAvailable( product );assert( total >= 0 );product = product->nxt;}return total;}171819202122

23242526return one of {2, 3}int isAvailable(node* product){ assert( product->items >= 0 )if ( notInitialized (product) ){ int ret_0=0; assert(ret_0 == 0 || ret_0 == 1); return ret_0; }if ( product->items > 0 ){ int ret_1=0; assert(ret_1 == 0 || ret_0 == 1); return ret_1; }int ret_2=0; assert(ret_2 == 0 || ret_2 == 1); return ret_2;}10

111213141516long availableProducts( t_store* store ){node* product = store->products;long total = 0;

while ( product != 0 ) {total += isAvailable( product );assert( total >= 0 );product = product->nxt;}long ret_0 = total; assert (ret_0 == 0 || ret_0 == 3); return ret_0;}10

111213141516171819202122

23242526int isAvailable(node* product){