2014-12-04

The baseline

What is the base line? What is this blog about?
For a few weeks I've started working on a new place. Before that I worked at one of the best places I've ever worked. It was great because of the team, because of the opportunities, and the challenges.


The Past

Approximately two and a half years ago when I joined that company, there was a working, but quite buggy application, written in PHP, based on a PHP framework. To make sure I'm not giving any unintentional help to the bad guys: the name of the framework will remain a secret. 
The framework provided all the features you could guess, access to session, input handling, database access on different levels, and of course, because it was an MVC framework, the basic separation of logic, db access, and views were in place. 

But that was it, really. Of course, there were version control and ticketing in place, but nothing more. The development work happened on a dev server; there was a test environment for customers and for the staff, and the live servers. 

There were one or two tools to help the daily work - like a deployment tool to the test and dev environment, and some configuration tools.

Delivery was a bit hectic - dev estimations were a bit clunky, the new BA just started doing his job, and quite frankly the overall feeling was a bit "ad-hoc"ish. 

But the head of development had big dreams, and he shared those dreams with us. He wanted to be in a place where we are reliable, we deliver on time. Our codebase is in a better condition (fewer bugs)... He dreamed about Continuous integration, and Continuous Delivery - with automated tests in place (Unit, and something we did not know at the time : Selenium).

When I joined the company, I managed the day-to-day work, and I kept the developers "entertained" :) busy in other words, and tried to squash the bugs we had in the system.
Doing this I was able to support two things. One was to get the code into a better shape - we did plenty of code refactoring and optimization. The second was less trivial at the beginning: I bought time for my boss to deal with his dream and find better tools.

The result


Two and a half years later the codebase is massive, robust. There is CI and CD in place, unit and selenium tests support development work. Bugs are now found in time - or if they slip through we take advantage of it and find a way how to prevent it next time.

On the plus side, the management also has got used to it. They are now comfortably rely on the predictable work and delivery timescales. 

Of course it was a way full of questions, but in the end we have arrived to a better place. 
And we have flipped the most annoying coin in all developers life: when there is a problem with the system you work on, the users thinks they did everything right and your application is sh*t. After all these hard work we are now on the other side: if something does not meet the user expectations or shows some weird behavior : they ask the question : "What have we done wrong?" 
What a difference!

The Baseline


But for me, this is the past.

Fresh start, and guess what. The new place is worse than I have ever imagined.
Let's see:
- No framework
- The code is mostly procedural PHP mixed with HTML and CSS and Javascript
- Native $_GET and $_POST and $_SESSION variables everywhere.
- No XSS or SQL injection prevention
- No tests
- The have just started using version control (my first revision number is 16)
- They have just started using a ticketing system
- "Deployment" means copying files from one place to another (not even using the version control diff / or commit info about what files are changed and how)
- No code review

Whoa! I did not mention the framework name above to protect a system, and now I am telling these security holes? Don't worry, the major issues are now patched, and there is prevention in place. That's the reason why I did not start this blog sooner.

The purpose of the blog

Now I have seen what to do, and how. I have learned a lot during my previous role. Now is the time to prove it,  and to lead these changes. 
I will talk about how the code refactoring goes, how the new systems are implemented (UnitTesting, Selenium, Jenkins, Continuous Integration / delivery, Framework), deployment process. 
I would like to invite you to be my partner during this journey from code-hell to a similar place where I have been once :)


No comments:

Post a Comment