This document discusses test-driven development (TDD) and unit testing in ABAP. It provides an overview of unit testing, the xUnit testing framework, and how to implement unit testing in ABAP using ABAP Unit. The document also explains test-driven development and how to follow the test-first development cycle of writing a test, writing just enough code to pass the test, and then refactoring the code.
5. Unit Testing
Unit Testing is a method by which
individual units of source code are
tested to determine if they are fit to
use.
6. Unit Testing
Unit Testing is a method by which
individual units are e.g.ource code
fittMethods of t Function Modules fit
Function Groups
fiMoModule Pools Function
Functn Reports
Methods
Function Groups
7. Unit Testing
aim:
Find bugs early
Write once, run often
Effective Tests must be automated
solution:
xUnit Frameworks
10. xUnit Framework
Provides an automated solution with no
need to write the same tests many times
and no need to remember what should be
the result of each test.
25. Test Driven Development
• Never
• After you wrote your code
• Before you write your code
When do you write your Unit Tests?
26. Test Driven Development
• Never
• After you wrote your code
• Before you write your code
When do you write your Unit Tests?
Test Driven Development
41. Code Kata: Roman Numerals
Rules:
• 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 items
I 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.
C
The numeral 100. C is short for the Latin word Centum,
but Century is eaysier to remember ;-)
D The numeral 500.
M The numeral 1000.