Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

ABAP Unit and TDD

2,520 views

Published on

Introduction into Test Driven Development (TDD) with ABAP Unit.

Presented at SAP Inside Track Hamburg (sitHH) 2013: http://wiki.sdn.sap.com/wiki/display/events/SAP+Inside+Track+Hamburg+2013

Published in: Technology, Business
  • If you are looking for customer-oriented academic and research paper writing service try ⇒⇒⇒ WRITE-MY-PAPER.net ⇐⇐⇐ liked them A LOTTT Really nice solutions for the last-day papers
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • If you are looking for customer-oriented academic and research paper writing service try ⇒⇒⇒ WRITE-MY-PAPER.net ⇐⇐⇐ liked them A LOTTT Really nice solutions for the last-day papers
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • You can ask here for a help. They helped me a lot an i`m highly satisfied with quality of work done. I can promise you 100% un-plagiarized text and good experts there. Use with pleasure! ⇒ www.HelpWriting.net ⇐
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • If you’re looking for a great essay service then you should check out ⇒ www.WritePaper.info ⇐. A friend of mine asked them to write a whole dissertation for him and he said it turned out great! Afterwards I also ordered an essay from them and I was very happy with the work I got too.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Nice topic. I just installed ADT and will use TDD in my current project.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

ABAP Unit and TDD

  1. 1. ABAP Unit and TDDHendrik NeumannSAP Inside Track Hamburg 2013Copyright © 2013 evivax IT ConsultingGmbH Goebelstraße 21 | 64293 Darmstadt | Fon: 06151 - 506420 | e-mail: mail@evivax.de
  2. 2. Agenda Unit Testing & ABAP Unit Test Driven Development (TDD) Live CodingCopyright © 2013 evivax IT ConsultingGmbH Goebelstraße 21 | 64293 Darmstadt | Fon: 06151 - 506420 | e-mail: mail@evivax.de
  3. 3. Unit TestingUnit Testing is a method by whichindividual units of source code are testedto determine if they are fit to use.Copyright © 2013 evivax IT ConsultingGmbH Goebelstraße 21 | 64293 Darmstadt | Fon: 06151 - 506420 | e-mail: mail@evivax.de
  4. 4. xUnit FrameworkProvides an automated solution with noneed to write the same tests many timesand no need to remember what should bethe result of each test.Copyright © 2013 evivax IT ConsultingGmbH Goebelstraße 21 | 64293 Darmstadt | Fon: 06151 - 506420 | e-mail: mail@evivax.de
  5. 5. xUnit FrameworkCopyright © 2013 evivax IT ConsultingGmbH Goebelstraße 21 | 64293 Darmstadt | Fon: 06151 - 506420 | e-mail: mail@evivax.desetup( )  test_method( )  teardown( )assert_*( ) – methods
  6. 6. xUnit FrameworkCopyright © 2013 evivax IT ConsultingGmbH Goebelstraße 21 | 64293 Darmstadt | Fon: 06151 - 506420 | e-mail: mail@evivax.desetup( )  test_method( )  teardown( )test_method( )test_method( )test_method( )test_method( )test_method( )test_method( )
  7. 7. ABAP UnitSAP‘s xUnit implemenationCopyright © 2013 evivax IT ConsultingGmbH Goebelstraße 21 | 64293 Darmstadt | Fon: 06151 - 506420 | e-mail: mail@evivax.de
  8. 8. ABAP Unit Local test classes for global dev. artifacts In Reports, Function Modules and Classes Not acitve on production systemsCopyright © 2013 evivax IT ConsultingGmbH Goebelstraße 21 | 64293 Darmstadt | Fon: 06151 - 506420 | e-mail: mail@evivax.de
  9. 9. ABAP Unit Tools integration: ABAP Workbench Code Inspector Integration ABAP Unit Browser ABAP Test Cockpit (ATC) ABAP in EclipseCopyright © 2013 evivax IT ConsultingGmbH Goebelstraße 21 | 64293 Darmstadt | Fon: 06151 - 506420 | e-mail: mail@evivax.de
  10. 10. Test Driven DevelopmentCopyright © 2013 evivax IT ConsultingGmbH Goebelstraße 21 | 64293 Darmstadt | Fon: 06151 - 506420 | e-mail: mail@evivax.de
  11. 11. Test Driven Development Never After you wrote your code Before you write your codeCopyright © 2013 evivax IT ConsultingGmbH Goebelstraße 21 | 64293 Darmstadt | Fon: 06151 - 506420 | e-mail: mail@evivax.deWhen do you write your Unit Tests?Test Driven Development
  12. 12. Test Driven DevelopmentTest 1stCopyright © 2013 evivax IT ConsultingGmbH Goebelstraße 21 | 64293 Darmstadt | Fon: 06151 - 506420 | e-mail: mail@evivax.de
  13. 13. Test Driven DevelopmentTest Cycle:red  green  refactorCopyright © 2013 evivax IT ConsultingGmbH Goebelstraße 21 | 64293 Darmstadt | Fon: 06151 - 506420 | e-mail: mail@evivax.de
  14. 14. TDD CycleCopyright © 2013 evivax IT ConsultingGmbH Goebelstraße 21 | 64293 Darmstadt | Fon: 06151 - 506420 | e-mail: mail@evivax.deWrite a test that expresses how you’lluse the code and what you need it to do.
  15. 15. TDD CycleCopyright © 2013 evivax IT ConsultingGmbH Goebelstraße 21 | 64293 Darmstadt | Fon: 06151 - 506420 | e-mail: mail@evivax.deWrite enough code to get thetest to pass, but no more.
  16. 16. TDD CycleCopyright © 2013 evivax IT ConsultingGmbH Goebelstraße 21 | 64293 Darmstadt | Fon: 06151 - 506420 | e-mail: mail@evivax.deClean up the code to removeredundancy and improve the design.
  17. 17. TDD CycleCopyright © 2013 evivax IT ConsultingGmbH Goebelstraße 21 | 64293 Darmstadt | Fon: 06151 - 506420 | e-mail: mail@evivax.de
  18. 18. Code Kata: Roman NumeralsCopyright © 2013 evivax IT Consulting GmbHGoebelstraße 21 | 64293 Darmstadt | Fon: 06151 - 506420 | e-mail: mail@evivax.deRules:• smaller number in front of a larger number  subtraction• all else  addition• put only one smaller number in front of a larger number• ones, tens, hundreds and thousands are separate itemsI The numeral one. II is two, III is three.V The numeral 5. IV is 4, VI is 6, VII is 7, VIII is 8.X The numeral 10. IX is 9, XI is 11, etc.L The numeral 50. XL would be 40.CThe numeral 100. C is short for the Latin word Centum, but Centuryis eaysier to remember ;-)D The numeral 500.M The numeral 1000.
  19. 19. So Long, and Thanks for All the FishAny Qs?Copyright © 2013 evivax IT ConsultingGmbH Goebelstraße 21 | 64293 Darmstadt | Fon: 06151 - 506420 | e-mail: mail@evivax.de

×