Python SDET Bootcamp

Python SDET Bootcamp

Lesson 87: Refactoring & Cleanup

Module 9: The Master Capstone — Building an Industry-Grade Framework

systemdr19's avatar
systemdr19
Aug 05, 2026
∙ Paid

The Junior Trap: “It Works On My Machine”

Imagine handing your car keys to a mechanic who says, “I don’t label my tools, I just remember where they are.” That’s fine — until they get sick, or until you hire a second mechanic. Your UQAP codebase is no different.

A junior dev or transitioning manual tester usually writes code like this:

# junior_trap.py
def login(d, u, p):
    d.find_element("id", "user").send_keys(u)
    d.find_element("id", "pass").send_keys(p)
    d.find_element("id", "btn").click()
    return True

def check_dashboard(d,user_name,timeout=10):
    import time
    time.sleep(timeout)
    el = d.find_element("class name","welcome")
    if user_name in el.text:
        return True
    return False

This code works. It will pass a demo. It will also:

  • Break the moment a second engineer edits it (variable d? what type is that?)

  • Fail mypy and flake8 CI gates, blocking the entire merge queue

  • Create silent type bugs — what if timeout receives "10" (a string)?

  • Make code reviews 3× slower because nobody knows the contract of each function

This is not a style debate. In a production CI/CD pipeline, unformatted, untyped code is a build failure.


User's avatar

Continue reading this post for free, courtesy of HandsOn Automation Bootcamp.

Or purchase a paid subscription.
© 2026 SystemDR Inc · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture