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:

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