Presentation is loading. Please wait.

Presentation is loading. Please wait.

Unit Testing and Continuous Integration in context of IFDK reference product.

Similar presentations


Presentation on theme: "Unit Testing and Continuous Integration in context of IFDK reference product."— Presentation transcript:

1

2 Unit Testing and Continuous Integration in context of IFDK reference product

3 About this course material -This material if for general training for Test Design and management -Material is more supportive in class room -Material will be updated during courses -FreeNest Portable Project Platform is used to demonstrate things only in practice. This is not limiting usage for material for other training environments (I hope ) About material

4 TESTING LEVELS

5 Unit/Module/Compone nt Testing Customer/Business Requirements Customer/Business Requirements Sub System Requirements Sub System Requirements Component Requirements Component Requirements Component / Unit Testing Component / Unit Testing Integration Testing Integration Testing System Testing System Testing Acceptance Testing Acceptance Testing System Requirements System Requirements Architecture& Design& Implementatio n Architecture& Design& Implementatio n Product VALIDATION VERIFICATION Yläotsikko

6 What should be tested? How ?

7 How to verify component implementation -Unit Testing -Static Analyze -Dynamic Analyze -Unit Testing -Static Analyze -Dynamic Analyze Yläotsikko

8 Input ? Output?

9 http://www.ibm.com/developerworks/rational /library/content/RationalEdge/sep04/bell/

10 xUnit Framework http://en.wikipedia.org/wiki/XUnit Implementation Test Framework

11 Component /Unit Testing Class Attributes Class Methods Class Attributes Class Methods Attributes TestClass TestMethodCall Unit Test Frame Work Test Method Call Method Result A=1 B=2 C=Class.TestMethodCo untValues(A+B) C<>3 FAIL C=3 PASS Implemented Class MethodCountValues( int x, int y) z=x+y+1 Return z Developer

12 Test Driven Development and Unit Testing Class Attributes Class Methods Class Attributes Class Methods Attributes TestClass TestMethodCall Unit Test Frame Work Test Method Call Method Result A=1 B=2 C=Class.TestMethodCo untValues(A+B) C<>3 FAIL C=3 PASS Implemented Class MethodCountValues( int x, int y) z=x+y+1 Return z Developer DEFINE TEST CASES FIRST!!! DEFINE TEST CASES FIRST!!! IMPLEMENT CODE AGAINST TESTS IMPLEMENT CODE AGAINST TESTS

13 Implemented Software Component #1 Implemented Software Component #1 Implemented Software Component #3 Implemented Software Component #3 Implemented Software Component #4 Implemented Software Component #4 Implemented Software Component #2 Implemented Software Component #2 Software Product Integration Software Product Integration Developer 1 Developer 2 Developer 3 Developer 4 Test Sand Box TESTS Integration test engineer #2Integration test engineer #1

14 Analyzing your implementation? 10 CLS: PRINT TAB(15); "Polysons': PRINT 20 PI=3. 14159: TP=PI*2 30 INPUT "Number of Sides';SD 40 INPUT "Size (5 to 80)';SZ 50 SP=TP/SD 60 SCREEN 1 70 FOR A=0 TO TP+SP/2 STEP SP 90 X=SZ*SIN(A)+100 100 Y=SZ OS(A)+96 110 IF A=0 THEN 130 120 LINE (X0, Y0)-(X, Y) 130 X0=X:Y0=Y 140 NEXT 150 GOTO 150 http://www.atarimagazines.com/creative/v10n5/158_Simple_screen_ graphics_wi.php ?

15 Code Coverage An analysis method that determines which parts of the software have been executed (covered) by the test suite and which parts have not been executed, e.g. statement coverage, decision coverage or condition coverage. http://en.wikipedia.org/wiki/Code_coverage http://www.atlassian.com/software/clover/ Yläotsikko http://en.wikipedia.org/wiki/Cyclomatic_comp lexity http://java.net/projects/hudson/lists/dev/archive/2009-03/message/235

16 Code Coverage - Branch coverage The percentage of branches that have been exercised by a test suite. 100% branch coverage implies both 100% decision coverage and 100% statement coverage. Yläotsikko http://booster911.hubpages.com/hub/BranchDecisionTesting

17 Code Coverage - Line coverage The percentage of branches that have been exercised by a test suite. 100% branch coverage implies both 100% decision coverage and 100% statement coverage. Yläotsikko http://booster911.hubpages.com/hub/BranchDecisionTesting

18 Static Code Analyze – Heat Map Yläotsikko http://www.statsvn.org/demo/ruby/

19 Feature Component Feature Component Project Manager Designer/Coder Integration Test Engineer Integration Test Engineer Test Manager System Testing Feature Unit/Integration Testing System Acceptance Testing System Test Engineer System Test Engineer Test Automation Engineer Test Automation Engineer Acceptance Test Engineer Acceptance Test Engineer Validation Verification Product verification/validation and test automation Regression Testing Integration Testing Functional System Testing Acceptance Testing Unit Testing Product Release Component Integration Testing A A A A A Load, Stress, performance Load, Stress, performance

20 Continuous Integration

21 Source Code Repository Build Server Build 6. Report Code Commit Change Trigger 1. 2. 3. Execute Build CODER Continuous Integration Job Report 4. Report One Commit Cycle

22 Analyzing & Unit Testing & CI

23 Code Checker Builder Make / Ant Gcc Javac Integration Tester Unit Tester Complexity Analyze Heat Map Source Code Interface Tester Statical AnalyzeDynamical Analyze

24 Source Code Repository Build Server Build Test Report Release Analyze Release Build Report Code Commit Report Change Trigger Build Request Build Slave Advanced Continuous Integration Job

25 Source Code Repository Build Server Build Test Report Release Analyze Release Build Report Code Commit Report Change Trigger Build Request Build Slave Job

26 Source Code Repository Build Server Build Test Report Release Analyze Release Build Report Code Commit Report Change Trigger Build Slave Build Test Report Release Analyze Release Build Build Slave Build Test Report Release Analyze Release Build Build Slave Build Request Windows Linux Mac OS Job

27 http://buildbot.twistedmatrix.com/waterfall

28 http://en.wikipedia.org/wiki/Continuous_integration

29 Integration Testing

30 Integration Test with stubs Tested Component/Application Log STUB/MOCK Component Scripted STUB Interface Control Configure Control Configure Simulated Interface Simulated Interface Messages/Events STUB/MOCK Component Control Interface Yläotsikko

31 in practice #1 IFDK android setup Tested Component Application Tested Component Application Activate/Control STUB/MOCK Component Scripted STUB Interface Control Configure Control Configure Simulated Interface Simulated Interface Messages/Events WEB SERVER simulating Service interface WEB SERVER simulating Service interface Control Interface Trace/Log Yläotsikko

32 in practice #2 server component testing Tested Component Application Tested Component Application Trace/Log Activate/Control Mock Server/Daemon Scripted STUB Interface Automated Test Interface Automated Test Interface Simulated Interface Simulated Interface Messages/Events WEB SERVER Control Interface Operating System Needed Fake Application Needed Fake Application Junit Scripted Interface Yläotsikko

33 Integration Testing with simulated Interfaces Fake Spotify Server Fake Spotify Server Fake Facebook Server Fake Facebook Server Simulated Bluetooth Interface Simulated Bluetooth Interface Simulated MIDI Interface Simulated MIDI Interface

34 What should be tested? How ? DB Appcliation

35

36 Yläotsikko

37


Download ppt "Unit Testing and Continuous Integration in context of IFDK reference product."

Similar presentations


Ads by Google