SlideShare a Scribd company logo
Test-DrivenDevelopment
Write better code
in less time
Md. Hasan Basri (Angel)
Full Stack Java SE/EE Engineer | Life Long Learner
www.linkedin.com/in/pothiq/
pothiq@gmail.com
INTELLIGENCE
IS
A LIABILITY!
SMART PEOPLE
Can make progress …
… without process
(This is NOT a good thing)
Washing hands
and organizing
surgical tools
wastes a lot of
time. I could
help more
patients if I just
dove in.
We know how
skyscrapers
work.
Just give us
some bricks
and we'll get
started.
PROFESSIONALS:
• Design, plan and prepare first
• … do the work
• This produces better results faster
PROCESS IS THE
DIFFERENCE BETWEEN:
Surgery … and …
Cutting
people
open
PROCESS IS THE
DIFFERENCE BETWEEN:
Engineering … and … Tinkering
PROCESS IS THE
DIFFERENCE BETWEEN:
Software
Engineering
… and … Programming
If I take the
Time to write
tests,
I won't finish
this feature
on time.
(Don’t be this guy)
I'll go back
and write
the tests
afterwards.
(Don’t be this guy either)
(Too Late!)
SOFTWARE PROCESS:
• Architecture
• Conventions & Standards
• Version Control
• Coordination (agile, etc.)
• Test-driven development
Test Driven Development
TESTS PROVIDE:
• Documentation of code
• Catch feature errors
• Long-term time savings
But test are just a tool, not a process.
TDD DEFINED:
• Decide what the code will do
• Write a test that will pass the code dost that
thing
• Run the test, see it fail
• Write the code
• Run the test, see it pass
TDD PROVIDES:
• Design and plan before you code
• Document your design
• Proof that code implements design
• Encourages design of testable code
TESTABLE CODE:
Looks a lot like good code!
• Modular
• Decoupled design
• Methods of limited scope
• etc.
RESULTS:
Better code in LESS TIME.
CAVEAT:
You will have to do this for a while
before you will be faster.
CAVEAT #2:
Intelligence is an Asset!
USE JUDGEMENT:
• Some things are too hard to test
• Some tests are too trivial to be useful
• Over testing is possible
• Exploratory coding w/o tests is OK!
RECAP
Test Driven Development
Variety of Options
TDD Cycle
Test Cases Acceptance Criteria
Time when bug is found …
Acceptance Test Driven Development
Tools For TDD/ATDD
LET’S DO SOME EXERCISE
jUnit Sample
• We will try to satisfy following conditions.
Condition for Password acceptance:
1. The password should be between 5 to 10 characters.
.
jUnit Sample
To run test, we create class PasswordValidator ()
jUnit Sample
We will run above class TestPassword ();
Test Driven Development

More Related Content

PPT
Code Quality
PPTX
Understanding Why Testing is Importaint
PPTX
Unit Test Lab - Why Write Unit Tests?
PDF
Code Review Matters and Manners
PDF
How to quickly add a safety net to a legacy codebase
PPTX
Code Quality Assurance
PDF
Why and how to keep your code quality
PDF
Test Driven Development
Code Quality
Understanding Why Testing is Importaint
Unit Test Lab - Why Write Unit Tests?
Code Review Matters and Manners
How to quickly add a safety net to a legacy codebase
Code Quality Assurance
Why and how to keep your code quality
Test Driven Development

What's hot (20)

PPTX
Code Review
PPTX
Clean code - Getting your R&D on board
PPTX
TDD & Effective Software Development
PPTX
TDD with RSpec
PPTX
Is Groovy better for testing than Java?
PPTX
Test Driven Development: More Development Than Ever
PPTX
Level Up Your Automated Tests
PPT
Clean code
PPTX
Clean code coding like a professional
PPTX
Code Review Best Practices
PPTX
Clean code, Feb 2012
PPTX
Clean Code
PPTX
Working with Legacy Code
PDF
Code Review for iOS
PPTX
Training methdology testers to developers
PPT
TDD - Christchurch APN May 2012
ODP
CLEAN CODE
PDF
Level Up Your Automated Tests
PDF
Lessons learned with Bdd: a tutorial
PPTX
Exceptions: Why, When, How and Where!
Code Review
Clean code - Getting your R&D on board
TDD & Effective Software Development
TDD with RSpec
Is Groovy better for testing than Java?
Test Driven Development: More Development Than Ever
Level Up Your Automated Tests
Clean code
Clean code coding like a professional
Code Review Best Practices
Clean code, Feb 2012
Clean Code
Working with Legacy Code
Code Review for iOS
Training methdology testers to developers
TDD - Christchurch APN May 2012
CLEAN CODE
Level Up Your Automated Tests
Lessons learned with Bdd: a tutorial
Exceptions: Why, When, How and Where!
Ad

Similar to Test Driven Development (20)

PDF
Real developers-dont-need-unit-tests
PDF
Real developers-dont-need-unit-tests
PDF
Real developers-dont-need-unit-tests
PDF
Test Driven Development (TDD)
PPTX
TDD - Seriously, try it - Codemotion (May '24)
PDF
Test-Driven Developments are Inefficient; Behavior-Driven Developments are a ...
PPTX
{10.0} Test Driven Development.pptx
PPT
Test-Driven Development
PPTX
TDD - Seriously, try it! (updated '22)
DOCX
fe.docx
PPTX
Test driven development v1.0
PPTX
TDD - Seriously, try it! - Opensouthcode
PDF
Hey You Got Your TDD in my SQL DB by Jeff McKenzie
ODP
Effective TDD - Less is more
PDF
Test driven development
PPTX
Test-Driven Development In Action
PPTX
TDD - Seriously, try it! - Bucarest Tech Week
PDF
Test Driven Development (TDD)
PPTX
Understanding TDD - theory, practice, techniques and tips.
PPTX
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Real developers-dont-need-unit-tests
Real developers-dont-need-unit-tests
Real developers-dont-need-unit-tests
Test Driven Development (TDD)
TDD - Seriously, try it - Codemotion (May '24)
Test-Driven Developments are Inefficient; Behavior-Driven Developments are a ...
{10.0} Test Driven Development.pptx
Test-Driven Development
TDD - Seriously, try it! (updated '22)
fe.docx
Test driven development v1.0
TDD - Seriously, try it! - Opensouthcode
Hey You Got Your TDD in my SQL DB by Jeff McKenzie
Effective TDD - Less is more
Test driven development
Test-Driven Development In Action
TDD - Seriously, try it! - Bucarest Tech Week
Test Driven Development (TDD)
Understanding TDD - theory, practice, techniques and tips.
Building In Quality: The Beauty Of Behavior Driven Development (BDD)
Ad

More from Md. Hasan Basri (Angel) (9)

PPTX
Introduction to Apache Hadoop Eco-System
PPTX
Information Security Engineering
PPTX
Introduction to Blockchain Technology
PPTX
MicroService Architecture
PPTX
Introduction to Bank Reconciliation
PPTX
Agile/Scrum Methodology Gains Your Productivity
PPTX
ISO 8583 Financial Message Format
PPT
Signature based virus detection and protection system
PPTX
XML Key Management Protocol for Secure Web Service
Introduction to Apache Hadoop Eco-System
Information Security Engineering
Introduction to Blockchain Technology
MicroService Architecture
Introduction to Bank Reconciliation
Agile/Scrum Methodology Gains Your Productivity
ISO 8583 Financial Message Format
Signature based virus detection and protection system
XML Key Management Protocol for Secure Web Service

Recently uploaded (20)

PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
top salesforce developer skills in 2025.pdf
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
System and Network Administraation Chapter 3
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
AI in Product Development-omnex systems
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
top salesforce developer skills in 2025.pdf
Design an Analysis of Algorithms II-SECS-1021-03
Softaken Excel to vCard Converter Software.pdf
PTS Company Brochure 2025 (1).pdf.......
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Odoo POS Development Services by CandidRoot Solutions
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
System and Network Administraation Chapter 3
Reimagine Home Health with the Power of Agentic AI​
Design an Analysis of Algorithms I-SECS-1021-03
CHAPTER 2 - PM Management and IT Context
How Creative Agencies Leverage Project Management Software.pdf
How to Choose the Right IT Partner for Your Business in Malaysia
Upgrade and Innovation Strategies for SAP ERP Customers
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
AI in Product Development-omnex systems
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free

Test Driven Development