Mark Niebergall presented on reducing technical debt by avoiding adding new debt, paying off existing debt through a repeating process, and tips on when to refactor code versus initiating a rewrite. He defined technical debt as consequences of poor design and architecture that are incurred knowingly and inadvertently. Examples of debt include unused code, outdated technology, and overcomplicated code. Sources of debt include changes to libraries, frameworks, and inexperience. Paying off debt requires identifying issues, prioritizing work, and making improvements over time through consistent effort.
3. About Mark Niebergall
● PHP since 2005
● Masters degree in MIS
● Senior Software Engineer
● Drug screening project
● UPHPU President
● SSCP, CSSLP Certified and SME
● Drones, fishing, skiing, father, husband
4. UPHPU
● 3rd Thursday of each month in Lehi
● PHP and related topics
○ Friday 6pm OpenWest review
○ August - Git
○ September - PHP TestFest
○ October - Defensive Coding
● Networking, community
● Pizza, pop, dessert, swag
5. About Mark Niebergall
● German
● Ancestry.com: nickname for someone who
habitually failed to repay his debts
12. Definition
● Consequences of poor design, architecture
● Prudent vs reckless
● Incurred knowingly and inadvertently
● Work needed to complete job properly
18. Clearance Rack
● Food about to expire
● Questionable dairy and bread
● Items that have been sitting on the shelf a
little too long
19. University Bid Sales
● Aging computers and hardware
● Obsolete items
● Never opened items
● Broken items needing repair or parts
● Piles of cables and adapters
23. The Problem - Updates
if ( !isNaN(parseFloat(a))
|| isFinite(a)
|| !isNaN(parseFloat(b))
|| isFinite(b)
) {
throw “Not a number”;
}
return (a + b).toFixed(2)
24. The Problem - Files
index.html
stuff.js
morestuff.js
moreawesomestuff.js
utilities.js
core.js
25. The Problem - Database
Table: person
Columns: name, address, address1, city, state,
zip, phone, phone2, phone3, email, email2,
address_mailing, address1_mailing,
city_mailing, state_mailing, zip_mailing,
create_timestamp_string, …
26. The Problem - Database
Table: thing
Columns: name, description, image,
what_it_does, hours, location, cost, time,
owner, obscure_field, ts, sd, or, qa, ei, num, +
50 more columns
27. The Problem - Security
$sql = “SELECT * FROM big_table WHERE
something = “ $_POST[‘from_user’];
$result = mysqli_query($sql);
37. Impact
● Increased time to deliver new features
● Increased time to maintain application
● Increased time paying off debts
● Increased code complexity
42. Avoid Debt - Technical
● Use a framework
● Be open to new technologies
43. Avoid Debt - Technical
● Package Manager
● Move 3rd party library out of project code
● Keep libraries, software up-to-date
● “Life is too short for old software” - Sebastian
Bergmann
44. Avoid Debt - Technical
● Unit tests
● Loosely coupled code
● Code reusability
● Reduce code complexity
● Leverage language features
45. Avoid Debt - Technical
● Static code analysis tools
○ Automated way to check code health
○ Unit test coverage
○ Coding standards
○ Unused code
○ Design patterns
○ Metrics
○ Methods doing too much
46. Avoid Debt - Technical
● Dynamic code review
○ Review by a human
○ Security reviews
○ Architecture
○ Linked functionality
○ Business rules
○ Functional bugs
50. Paying off Debt
● My experience with a big project
● Included PM, developers, devops, DBAs,
system administrators, QA, IT leadership
● Buy-in from upper management
● Application is faster, more stable, more
secure, modernized, easier to maintain
51. Paying off Debt
● Identified pain points
● Created epics
● Set priorities
● Defined user stories
52. Paying off Debt
● Assigned work, ownership
● Regular reporting as a team
● Regular reporting to management
68. Rewrite
● Sustainability of current solution is critical
● Large effort
● Long term benefits, not short
● Explore available technologies
● Prevent excessive new debt
● Higher risk of failure
70. Refactor
● Break effort up over time
● Results both short and long term
● Prioritize what to rework first
● Lower risk of failure
71. Rewrite vs Refactor
● Sustainability of current solution
● Level of effort
● Short and long term benefits
● Feasibility
● Technology stack
● Team capabilities
73. Technical Debt
● Metaphor
● Reduce your debt
● Pay off debt using repeating process
● Tools available for your project
● Apply understanding to improve architecture