Good and Bad Technical Debt (and how TDD helps) (2013)
blog.crisp.se
blog.crisp.se
startChrome();
goTo(“Google.com”);
write(“Helium”);
press(ENTER);
click(“Helium – Wikipedia”);
assert Text(“Helium is the second lightest element”).exists();
This is Java, Python bindings are also available. Note how no reference to any HTML source code properties is required (thus the tests can be written in a TDD style, before the implementation).
I should also point out that Helium is a commercial product, so you (/ your company) has to pay to use it.
driver.findElement(By.xpath("//input[@type='text' and @value='First Name']");
with
TextField("First Name");
Helium makes it much easier to identify the elements of the PageObject.
That's not to say that Helium is a silver bullet. It certainly always depends on the context. For instance, I know of a bank here in Austria that generates a lot of the Java source code for their internet banking app from an abstract model. They also generate page object code immediately from this abstract model, which is therefore always up to date and precise. This is one example where I would say using Helium would probably not pay off.
Ugly but standards-following output:
xpath=(((
//.[@data-test-label='foo'])[1]
//.[@data-test-label='bar'])[1]
//.[@data-test-label='baz'])[1]
/a
This defines a three-step search which skips over a lot of probably-unimportant tags.http://confreaks.com/videos/2448-railsconf2013-of-buyers-and...
tl;dr: Different kinds of technical debt have different interest rates. Paying loan shark or credit card rates for a long time is bad. Paying mortgage rates is fine. Not having any technical debt means you over payed up-front.
A lot of times you don't have the option because your resources at hand are scarce compared to what you need/want to buy, so debt is part of the calculus of allocating your current and (hopefully) future resources. And that's fine. It seems to me that's different from saying "no debt means you overpaid up front."
Plus, that sounds like the kind of thing non-technical management might deploy to neutralize discussion without having to engage with the issues at hand.
Over-design is a legitimate concern. But, if you don't know much design, however, you probably aren't going to fall into this trap. You're more liable to under-design things.
This is when you eventually come back and do some bigger refactoring and cleanup to drop back down before you hit your ceiling. But you have to decide if you want to stop all other development while you do this, or if you can be smart and pull off tricks to coordinate doing the work while stuff still happens and/or parallelize it without having too much overhead. All without really knowing for sure where the ceiling is because other stuff is going on outside of your JVM.
If your major GCs can't successfully clean up your survivor space then you end up caught in a loop of endless GC attempts without making progress, looking for anything you can clean up or refactor to reduce TDD, with very little success. You start wondering if it is even possible or if you should just SIGKILL it all and start over.
Sadly, the TDD side of it doesn't fit into this analogy ... at least not yet. You could definitely work the dark side of TDD into this though... brittle, inflexible poorly factored tests that are in and of themselves technical debt and take up valuable memory you could be using to scrape by.
I also highly recommend Denise from Dreamwidth's famous post on the subject, which is a great intro to the concept for not-so-technical people as well (it was written to explain to the user base what they'd been doing): http://denise.dreamwidth.org/57248.html
No, it raises the question.
Otherwise, a great article.