1 / 37

Unit Testing and Continuous Integration in context of IFDK reference product

Unit Testing and Continuous Integration in context of IFDK reference product. 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

Download Presentation

Unit Testing and Continuous Integration in context of IFDK reference product

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. UnitTesting and ContinuousIntegration in context of IFDK referenceproduct

  2. 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 ) Aboutmaterial

  3. TESTING LEVELS

  4. Unit/Module/Component Testing Product VALIDATION Customer/Business Requirements Acceptance Testing System Requirements Architecture& Design& Implementation System Testing Sub System Requirements Integration Testing Component Requirements Component / Unit Testing VERIFICATION Yläotsikko

  5. How to Test? What should be tested? How ?

  6. How to verify component implementation -Unit Testing -StaticAnalyze -DynamicAnalyze Yläotsikko

  7. What should be tested? Input ? Output?

  8. Class Diagram http://www.ibm.com/developerworks/rational/library/content/RationalEdge/sep04/bell/

  9. xUnitFramework Implementation Test Framework Implementation http://en.wikipedia.org/wiki/XUnit

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

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

  12. Ideal project team and unit testing Software Product Integration Integration test engineer #1 Integration test engineer #2 Test Sand Box Test Sand Box Test Sand Box Test Sand Box Developer 1 Developer 2 Developer 3 Developer 4 TESTS TESTS TESTS TESTS Implemented Software Component #3 Implemented Software Component #4 Implemented Software Component #2 Implemented Software Component #1

  13. Static Code Analyze 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

  14. CodeCoverage An analysismethodthatdetermineswhichparts of the software havebeenexecuted (covered) by the testsuite and whichpartshavenotbeenexecuted, e.g. statementcoverage, decisioncoverageor conditioncoverage. http://en.wikipedia.org/wiki/Code_coverage http://www.atlassian.com/software/clover/ http://java.net/projects/hudson/lists/dev/archive/2009-03/message/235 http://en.wikipedia.org/wiki/Cyclomatic_complexity Yläotsikko

  15. CodeCoverage - Branchcoverage The percentage of branchesthathavebeen exercisedby a testsuite. 100% branchcoverage impliesboth 100% decisioncoverage and 100% statementcoverage. http://booster911.hubpages.com/hub/BranchDecisionTesting Yläotsikko

  16. CodeCoverage - Line coverage The percentage of branchesthathavebeen exercisedby a testsuite. 100% branchcoverage impliesboth 100% decisioncoverage and 100% statementcoverage. http://booster911.hubpages.com/hub/BranchDecisionTesting Yläotsikko

  17. Static Code Analyze – HeatMap http://www.statsvn.org/demo/ruby/ Yläotsikko

  18. Product verification/validation and testautomation A Product Release Acceptance Test Engineer System AcceptanceTesting System Test Engineer AcceptanceTesting Test Manager System Testing Project Manager A Load, Stress, performance Designer/Coder Functional System Testing Integration Test Engineer A Regression Testing Test Automation Engineer Feature Unit/Integration Testing A IntegrationTesting Component IntegrationTesting Validation Feature Component Verification A UnitTesting

  19. Continuous Integration

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

  21. Analyzing & UnitTesting & CI

  22. Statical Analyze Dynamical Analyze Builder Make / Ant Gcc Javac Code Checker Unit Tester Complexity Analyze Integration Tester Source Code Interface Tester Heat Map

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

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

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

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

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

  28. Integration Testing

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

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

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

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

  33. System Testing in Small Appcliation DB What should be tested? How ?

  34. Application code level testing

  35. Yläotsikko

More Related