SOFTWARE
DEVELOPMENT
PROCESS
(TDD)
Autumn 1398
Amin Taheri @ Shenasa-ai.ir
#TODO
■ Definition of Software Development Process
■ Domain Driven Development (DDD)
■ Continuous Integration (CI)
■ Behavior Driven Development (BDD)
■ Extreme Programming (XP)
– Pair programming
– Standup meetings
■ Test Driven Development (TDD)
■ Hands of TDD (Live coding)
Definition of Software Development Process
■ Dividing Project into phases
■ A.K.A Software development Life-Cycle
■ Improving
– Design
– Product management
– Project management
Planning Analysis Design Development
and implement Testing Maintenance
Domain Driven development
■ How the Application should behave
■ Consider System as Black Box
■ Common Language
■ Define User story
– As a :
– I want :
– So That :
Continuous
Integration
(CI)
■ AKA Continuous
delivery
Behavior Driven Development
■ TDD + DDD
■ 3 phase of TDD
■ Common language of DDD
Extreme programming (XP)
■ TDD
■ Agile
■ DDD
■ CI
Pair programming
■ two programmers work together at one workstation
■ The two programmers switch roles frequently.
■ 3 kind of situation
– Novice & Novice (better together than solo)
– Pro & Novice (mentor apprentice)
– Pro & Pro (Can Also be good)
Test Driven Development (TDD)
■ Red, Green, Refactor
■ TDD is :
– define a test set for the unit first;
– make the tests fail;
– then implement the unit;
– finally verify that the implementation of the unit makes the tests succeed.
We will get to the details, Hold on!
TDD continued
More on TDD
More on TDD
Levels of testing
■ Unit test : function
■ Test suit : combination of unit test
■ Component testing
■ System testing
■ Performance testing : throughput, speed, memory management, etc.
How to test
■ #production code
■ # a unit test
– Setup
– Action
– Assert
Talk is cheap, show me the code!
-Linus Trovalds
Advantages of TDD
■ Changing becomes easy
■ Imminent feedback
■ Document what the code is doing
– by writing informative names for unit tests
■ Make a Good Object Oriented Design
Uncle Bob!
■ 3 law of TDD by uncle bob :
– do not write any production code before unit test
– you should not write a very complicated unit test
– you should not write any more production code than is sufficient to pass the
one failing unit test
■ this cycle of testing writing unit test and testing should not last longer than couple of
minutes
■ every unit test should test something new and do not test something that have been
tested before
Annotations
■ Functions:
– Def test_* ():
■ Class :
– Class Test_*
– Not having a __init__ func
■ filenames of test should start with "test_"
Acceptance Test-Driven Development
(ATDD)
■ includes customers, testers, and developers into the loop.
■ all project members understand what needs to be done
■ Advantages of Acceptance Test-Driven Development
– As we have ATDD very first, so it helps to reduce defect and bug fixing effort as
the project progresses.
– ATDD only focus on ‘What’ and not ‘How’.
– ATDD makes developers, testers, and customers to work together, this helps to
understand what is required from the system
Testing tips and tricks
■ Should be able to run frequently and fast
■ Automated testing
■ Different environments
– Production
– Development
■ Do not write all unit test or production at once! Follow the cycle
■ Do the simplest test case
■ do not jump into complex unit test
Tips and tricks continued
■ Use descriptive test case names
■ Unit test is the best document for code
■ Keep your unit test to run fast
■ Keep console output minimal
■ Use code coverage tools to determine that you cover all of your codes
■ Using code analysis tools such as Pylint
To read
■ Books
– Robert martin (the uncle bob)’s clean code
– Kent beck test driven development
■ Blogs
– https://towardsdatascience.com/tdd-datascience-689c98492fcc
– https://www.xenonstack.com/blog/machine-learning-unit-testing/
THANK YOU FOR YOUR
ATTENTION
Any questions?

Test driven development : software process

  • 1.
  • 2.
    #TODO ■ Definition ofSoftware Development Process ■ Domain Driven Development (DDD) ■ Continuous Integration (CI) ■ Behavior Driven Development (BDD) ■ Extreme Programming (XP) – Pair programming – Standup meetings ■ Test Driven Development (TDD) ■ Hands of TDD (Live coding)
  • 3.
    Definition of SoftwareDevelopment Process ■ Dividing Project into phases ■ A.K.A Software development Life-Cycle ■ Improving – Design – Product management – Project management Planning Analysis Design Development and implement Testing Maintenance
  • 4.
    Domain Driven development ■How the Application should behave ■ Consider System as Black Box ■ Common Language ■ Define User story – As a : – I want : – So That :
  • 5.
  • 6.
    Behavior Driven Development ■TDD + DDD ■ 3 phase of TDD ■ Common language of DDD
  • 7.
    Extreme programming (XP) ■TDD ■ Agile ■ DDD ■ CI
  • 8.
    Pair programming ■ twoprogrammers work together at one workstation ■ The two programmers switch roles frequently. ■ 3 kind of situation – Novice & Novice (better together than solo) – Pro & Novice (mentor apprentice) – Pro & Pro (Can Also be good)
  • 9.
    Test Driven Development(TDD) ■ Red, Green, Refactor ■ TDD is : – define a test set for the unit first; – make the tests fail; – then implement the unit; – finally verify that the implementation of the unit makes the tests succeed. We will get to the details, Hold on!
  • 10.
  • 11.
  • 12.
  • 13.
    Levels of testing ■Unit test : function ■ Test suit : combination of unit test ■ Component testing ■ System testing ■ Performance testing : throughput, speed, memory management, etc.
  • 14.
    How to test ■#production code ■ # a unit test – Setup – Action – Assert Talk is cheap, show me the code! -Linus Trovalds
  • 15.
    Advantages of TDD ■Changing becomes easy ■ Imminent feedback ■ Document what the code is doing – by writing informative names for unit tests ■ Make a Good Object Oriented Design
  • 16.
    Uncle Bob! ■ 3law of TDD by uncle bob : – do not write any production code before unit test – you should not write a very complicated unit test – you should not write any more production code than is sufficient to pass the one failing unit test ■ this cycle of testing writing unit test and testing should not last longer than couple of minutes ■ every unit test should test something new and do not test something that have been tested before
  • 17.
    Annotations ■ Functions: – Deftest_* (): ■ Class : – Class Test_* – Not having a __init__ func ■ filenames of test should start with "test_"
  • 18.
    Acceptance Test-Driven Development (ATDD) ■includes customers, testers, and developers into the loop. ■ all project members understand what needs to be done ■ Advantages of Acceptance Test-Driven Development – As we have ATDD very first, so it helps to reduce defect and bug fixing effort as the project progresses. – ATDD only focus on ‘What’ and not ‘How’. – ATDD makes developers, testers, and customers to work together, this helps to understand what is required from the system
  • 19.
    Testing tips andtricks ■ Should be able to run frequently and fast ■ Automated testing ■ Different environments – Production – Development ■ Do not write all unit test or production at once! Follow the cycle ■ Do the simplest test case ■ do not jump into complex unit test
  • 20.
    Tips and trickscontinued ■ Use descriptive test case names ■ Unit test is the best document for code ■ Keep your unit test to run fast ■ Keep console output minimal ■ Use code coverage tools to determine that you cover all of your codes ■ Using code analysis tools such as Pylint
  • 21.
    To read ■ Books –Robert martin (the uncle bob)’s clean code – Kent beck test driven development ■ Blogs – https://towardsdatascience.com/tdd-datascience-689c98492fcc – https://www.xenonstack.com/blog/machine-learning-unit-testing/
  • 22.
    THANK YOU FORYOUR ATTENTION Any questions?