Search
Close this search box.
Search
Close this search box.
Search
Close this search box.

5 steps to get unit tests going

Facebook
Twitter
LinkedIn
Pinterest
WhatsApp

Once you start unit testing, you will find significant benefits to your design, throughput, quality, and peace of mind. However, it is not easy to start in an organization that’s not used to it. Here are a number of practical tips:

First step: Make sure the motivation is there – as you will see down the list, this change (like most changes) will require the organization to invest time and work in it. Understand the current situation, understand the pains, get some statistics. There will usually be someone who tried writing unit tests – talk with them, try to understand the challenges. Have a kickoff meeting with the team, understand together why are you doing this and how will the process look like. Have a kickoff with management, you will definitely need their support, you need to be on the same page. Whenever it gets tough (it will), get back to this discussion.

Second step: Train the team – I think training should be minimal – just enough so people will understand what they’re going into. Most of the learning is on the job. I do one day training in which I teach the basics of unit tests in the specific technology (I had lately the opportunity of working with an organization in which I taught c# with visual studio tests, react/native with jest + testing library, angularjs with jest and java with junit). We do some TDD with mob programming and finish with unit tests on legacy code techniques.

At this point some people (highly motivated) may start experimenting. Help them.

Third step: Open roads in the legacy code – adding tests to legacy code is difficult at the beginning. Pair with motivated individuals to crack it up, and find patterns to use on their legacy code (see my video about this: English / Hebrew). Sometimes you’ll need utilities, sometimes you’ll need to do some refactoring to allow people to start work.

Are people starting to write tests? Sometimes they do.

Fourth step: Pair with developers – We had the training, we opened up the roads, and now it is time to start moving the ship. Experience tells me I need to sit with almost all developers and pair with them, writing their first tests. Only when you do that realization seeps in. There are many A-Ha moments, I like it.

You would expect people to start writing unit tests by this time. However, change is very difficult. Remember at the beginning writing the unit test is an additional effort. It returns the investment very fast but it is an additional effort.

Fifth step: Let developers write unit tests without you – this is where, together with the team, we start adding the tests gently into the definition of done. They must do it without you, they must wrestle with the legacy code to get it moving. Like other technological challenges, you need some intensity to grasp them. This is the difficult part.

The first time you change code that already has unit tests is a magical moment. The tests tell you the story in simple words, they guide you and keep you safe. The time and sweat were worth it.

 

Subscribe for Email Updates:

Categories:

Tags:

Agile Product Ownership
Kanban Kickstart Example
Scrum Values
Rapid RTC
Slides
Video
Risk-aware Product Development
Professional Scrum Master
Scrum With Kanban
Lean Budgeting
System Integration Environments
NIT
predictability
Atlassian
Agile India
Lean-Agile Software Development
Nexus and Kanban
Agile Outsourcing
Agile Basics
Kanban Game
Agile Product Development
Lean Software Development
Introduction to Test Driven Development
Certified SAFe
Self-organization
Pomodoro Technique
Acceptance Test-Driven Development
Software Development
Scrum Master Role
Frameworks
Agile
Lean Agile Organization
Professional Scrum Product Owner
Agile in the Enterprise
PI Planning
Coaching Agile Teams
Daily Scrum
SAFe
Releases Using Lean
LeSS
Professional Scrum with Kanban
DevOps
WIP
BDD
Lean Agile
Agile Delivery
Kanban Basics
Sprint Retrospectives
Tools
AI
Systems Thinking
POPM
Business Agility
Jira Cloud
Scrum Primer
Elastic Leadership
Risk Management in Kanban
Test Driven Development
Certification
Kaizen Workshop
Jira Plans
Agile Exercises
Agile Development
Software Development Estimation
Scaled Agile Framework
User stories
Legacy Code
Kanban
SPC
Accelerate Value Delivery At Scale
Achieve Business Agility
Built-In Quality
Portfolio for Jira
ART Success
SAFe Release Planning
Scrum and XP
Reading List
ATDD
Legacy Enterprise
Agile Mindset
AgileSparks
Value Streams
Quality Assurance
Lean Startup
Lean and Agile Principles and Practices
Continuous Deployment
Tips
ARTs
Process Improvement
Lean Agile Leadership
The Kanban Method
Agile Marketing
agileisrael
Story Slicing
Agile Risk Management
ROI
Code
Nexus
ATDD vs. BDD
Principles of Lean-Agile Leadership
Atlaassian
Agile Project Management
Sprint Iteration
What Is Kanban
Kaizen
Change Management
Continuous Delivery
Nexus vs SAFe
IT Operations
SA
AI Artificial Intelligence
GanttBan
Covid19
Lean-Agile Budgeting
Agile Release Planning
Agile for Embedded Systems
TDD
RSA
Jira
Jira admin
System Archetypes
QA
Effective Agile Retrospectives
Continuous Planning
Lean Agile Basics
Webinar
Lean Agile Management
Scrum
Applying Agile Methodology
Agile Games and Exercises
Large Scale Scrum
Limiting Work in Progress
Iterative Incremental Development
Agile Project
PI Objectives
Amdocs
Agile Contracts Best Practices
lean agile change management
Managing Risk on Agile Projects
System Team
Agile Games
Agile Community
Agility
Engineering Practices
Lean and Agile Techniques
RTE Role
Kanban 101
Operational Value Stream
Implementation of Lean and Agile
Planning
Spotify
Managing Projects
ScrumMaster Tales
Artificial Intelligence
Presentation
Scrum.org
Agile and DevOps Journey
Implementing SAFe
EOS®
Product Ownership
LAB
Manage Budget Creation
LPM
Agile Techniques
Development Value Streams
RTE
Continuous Integration
Nexus and SAFe
Introduction to ATDD
Scrum Guide
Release Train Engineer
Scrum Master
Agile Israel Events
A Kanban System for Software Engineering
Entrepreneurial Operating System®
Agile Assembly Architecture
Lean Risk Management
chatgpt
Product Management
Continuous Improvement
Agile Release Management
Nexus Integration Team
The Agile Coach
Advanced Roadmaps
speed at scale
Agile Israel
Sprint Planning
SAFe DevOps
Agile Program
Perfection Game
ALM Tools
Games and Exercises
Agile Testing Practices
Hybrid Work
An Appreciative Retrospective
speed @ scale
Risk Management on Agile Projects
Enterprise DevOps
AgileSparks
Logo
Enable registration in settings - general

Contact Us

Request for additional information and prices

AgileSparks Newsletter

Subscribe to our newsletter, and stay updated on the latest Agile news and events

This website uses Cookies to provide a better experience
Shopping cart