we're moving backwards

Published 07-20-2007 11:49 AM | jokiz

This is technically another rant (long overdue), sorry to the guys involved.

1.  From test-driven development to deadline-driven development

We are practicing test-driven development and continuous integration (okay, just some!).  I saw the following code comment in one of our code sheets:

Search uses ShipmentCriteria as intermediate object between UI and search engine. ShipmentCriteria is unnecessary but due to tight schedule, i couldnt delete it from the current implementation lest ill end up rewriting the presentation. Perhaps in a test driven development environment we can refactor this but for the deadline driven, this will do.

There are also ignored test cases with a comment "New search engine using deadline driven methodology."

Projects will always have deadlines, and in our company, developers are the ones estimating their tasks.  It's up to you to give an estimate which covers the inclusion of automated tests for it (if you want to, but actually nobody is forcing you).  Yes it's normal that a team couldn't find time to include automated tests for the project especially when the release date is very near.  However, there really are persons who are dedicated to the practice and finds time to include some tests especially for the crucial functionality.  Checking the subversion logs, he's the only one who have added test cases for the application.  If you are really dedicated to improve the project, drop your email and blog reading routine and contribute to the project by including tests for your feature (look who's talking, :p).

I've been monitoring the Unit Tests of my previous project and for the past couple of months, you won't notice an inclusion of the new test case in it, just modifications to adapt to the new requirements.  Coverage for the tests is continuously dropping sad to say.

2.  From subversion to non-versioned

My two teammates are working on the same task and chose to not integrate with my created versioned solution (I don't know why). 

I saw the junior guy using a CSV parser from some library when he asked me a question.  When I visited our lead's desk, I saw him doing a normal string.Split routine in his code for parsing (proven to be problematic!).  Smells fishy!

I found out that they are working in a non-versioned environment.  I asked them how are they integrating?  Senior guy is giving junior guy latest copy of his bits every morning.  Hmmm, interesting...

3.  From ASP.NET to ASP classic

  • was surprised why my teammate was coding a simple webpage table form in asp style (foreach script blocks in aspx page)
  • a consultant saw the implementation and commented that it's not the way we do in .NET (of course)
  • consultant proposed to do all the html creation logic in codebehind and assign the formed HTML (really?)
  • I proposed using asp.net data controls and databinding
  • teamlead commented data controls are costly pointing at hidden viewstate (classic argument)
  • me and junior guy did the page using asp.net data controls
  • code is now constructing an HtmlTable instance in the codebehind, lead's code, but he agreed to change it (thank god)
Filed under:

Comments

# jop said on July 19, 2007 8:20 PM:

# deadline driven development Ah, DDD, short for deadline driven development. At least you are not doing the other kind of DDD - document driven development. Btw, I need an MS Word plugin - if you know of a plugin that can syntax-highlight code and has intellisense - all inside the pristine confines of MS Word then I'll pay big bucks for it. :)

# jokiz said on July 19, 2007 8:24 PM:

what for?

# velocity said on July 19, 2007 8:43 PM:

How much big bucks are we talking about here? ;-)

# jokiz said on July 19, 2007 8:50 PM:

bastusan ba raw, cge pagbigyan ang mga bossing

# cruizer said on July 19, 2007 9:37 PM:

ha ha. jokiz i saw that "new search engine using deadline-driven methodology" comment before my last day in the company :P

personal observation though: using TDD didn't assure me of bug-free code. in fact some of the bugs that were reported during QA and UAT were because of my code :P but the tests helped me isolate the bugs and fix them. also doing TDD helped me come up with an API/interface that (I think) is usable.

that reinforces my belief that TDD is not about testing but designing software based on expected/desired behaviour.

# n.ocampo said on July 19, 2007 10:14 PM:

What a rant... it seems that you’ll going to reach your boiling point. “Deadline-driven development” Sacrificing the value of TDD. "Senior guy is giving junior guy latest copy of his bits every morning." >> Why? They don’t like using repository? Oh oh.. "From ASP.NET to ASP classic" >> this is funny. Why use ASP classic (I hate to see those inline codes.) when you can do it in ASP.NET with no pain.

# jop said on July 19, 2007 10:22 PM:

# jokiz - what for

Hehehe.. I've been doing a lot of coding in MSWord lately. We are required to get the documentation reviewed before starting coding.

# velocity - big bucks

two adult male antelopes :D

# cruizer - tdd

Now that you mentioned it, I should probably write an xUnit tool for MSWord. WUnit?

# barakoboy said on July 19, 2007 11:03 PM:

@cruizer very well said.

# jokiz said on July 19, 2007 11:30 PM:

@cruizer: agree that it doesn't assure bug free.  disagree on tdd is not about testing but designing classes.

tdd makes it possible for classes to be designed as testable, but in the end, all you wanted is to include automated tests EASILY.  these tests are the one helping you in the long run

automated tests are there to easily know if you've broken something, we all know how helpful it is.  if it's wrongly written, it will be discovered and should corrected.

# jop said on July 20, 2007 12:46 AM:

# cruizer - using TDD didn't assure me of bug-free code Yes it does assure me of bug-free code, BUT only on the code that is covered with test. # jokiz - disagree on tdd is not about testing but designing classes. TDD is about design - it forces you to think cohesion and coupling. It is also about requirements - you put your specs in the code, and you make it pass. BUT it doesn't stop there. Once your done with the test, then it moves on to its other role: as test.

# jokiz said on July 20, 2007 1:11 AM:

@jop, yep, agree that it is about design with a higher intention of "to test".  just disagreed on cruizer's comment "tdd is not about testing"

# cruizer said on July 20, 2007 1:29 AM:

well "TDD is not simply about testing" -- part of it, but not everything. i guess the reason why others shy away from TDD is because they think it's a replacement for actual testing, which it's not.

using TDD on the stuff you mentioned help me adapt the API quickly in the face of refactoring and changes. I probably wouldn't have pulled it off in a more efficient manner if not for the test harness (automated alright). It also helped me isolate class responsibilities.

# jokiz said on July 20, 2007 1:51 AM:

@cruizer - that's better than your first statement "TDD is not about testing".  :p.

# cruizer said on July 20, 2007 3:04 AM:

by golly yeah :D but to me the value of TDD is in allowing me to freely refactor code with wild abandon, knowing that the safety net of regression tests are there to keep me in check. thus I can easily evolve my classes and methods and see immediately that everything is still working as expected. so really it's more of a design tool to me ;)

# Jon Limjap said on July 22, 2007 9:51 PM:

Hehehe... Guilty as charged! (raises both hands and both feet)

Send me to the TDD slammer now ;)

When you're working with a non-TDD versed team (as we are at this point) someone has to somehow enforce it, usually the lead. But since no one is TDD-esque in the team anymore, including the lead, nobody's enforcing it, really, and many of the members treat the tests as obstacles rather than as tools.

# Jon Limjap said on July 22, 2007 9:59 PM:

Oh yeah... for #2: I eventually told the senior guy to ditch his CSV parser hand-coding and get a library. I'm not sure if he downloaded the same thing the junior guy was using. But it eventually saved him from all that trouble.

Seems to me senior guy has an NIH attitude that needs to be, ummm, regulated. :p

# DotNET @ Kape Ni LaTtEX » Blog Archive » The TDD wake-up call said on July 23, 2007 12:08 AM:

Pingback from  DotNET @ Kape Ni LaTtEX  » Blog Archive   » The TDD wake-up call

# velocity said on July 23, 2007 12:42 AM:

BDD is the course-correction needed for TDD. It's the same banana but peeled differently.

http://behaviour-driven.org/

# The Senior Guy said on August 2, 2007 1:51 AM:

Well i guess second guessing comes natural when all the facts are not available, but uninformed condemnation is wicked. First off, has it occured to anybody that maybe those DDD comments were a (witty) expression of utter frustration to of how the current code goes against everything this senior guy expected how the this project would be ran (in all its promised test driven-ness, sacred object orientation, and Agile-ness). When youre required by your manager to put in more than 10 hours or work everyday, to work on Saturdays and Sundays, (and, yes neglect your email and daily news browsing) just so you can hit what the upper people promised to deliver on a date that was set even before the senior guy started work with the company. When somebody goes by your desk to ask if how come you havent finished fixing 10 bugs, after all it has been 1 hour since the last time he asked you. It surely doesnt sound TDD to me and i wont call it by any other name. Here's a trivial exchange from that project: 1. mgr asked sr developer to fix n bugs of a system he just inherited. 2. sr guy says it'll take a month just to modify the code, 3. mgr ask to render all waking hours as overtimes to finish it in a week, 4. sr. dev asked about time for the unit testing, 5. mgr says skip it. And oh, by the way, did i mentioned this company promised the sr guy that they never do overtimes. The csv incident. Who made the sr guy the team lead?!? because i assure you the sr guy doesnt know it. The team lead is the guy who holds weekly meetings but everybody seems to be afraid of talking with (cept the sr guy of course). If one does a quick hack of csv-to-database persistence by using the quickest means possible, he wouldnt bother looking for the perfect tool. And surely he wont put it up under version control since its still not ready. And if a jr guy asks everyday for something to do to help but doesnt have an idea how, would the sr guy keep the source code to himself? By the way, has anybody seen the csv importation code lately? The one that actually made it to svn. Does it contain a single call to a Split() method? I always wondered why you decided to work on csv imports/display when we were assigned to do separate tasks. It cost time by you not working on your module and us doing redundant work that has to be integrated. and... and.. it went against the skills training of the jr guy by you thinking it througg for him. The ASP.net/ASP classic argument. As has been repeatedly mentioned by the team lead who holds weekly meetings, the whole point to the project is to get clients interested in what the system has to offer. Up to this point its still classified as inhouse and, hence, is paid for by the company as an expense (as opposed to being an income). The object is to demo it as soon as possible using (ASP.NET, ASP classic, perl, sql, or whatever.) The senior guy doesnt care, as long as it worked. The irony is the ASP.net version somehow got checked in with compile error. I dont think tdd is the only way to test code, but at least one should code the code before it is checked in. As to ASP.net vs ASP classic, thats another story worth another thread. Whew, nothing like a long rant against a long rant... Nice blog site. Best regards,

# jokiz said on August 2, 2007 2:57 AM:

@the senior guy

am sorry to hear about your bad experiences with the project.

"If one does a quick hack of csv-to-database persistence by using the quickest means possible, he wouldnt bother looking for the perfect tool. And surely he wont put it up under version control since its still not ready." - i disagree, if it is a team development (2 counts as a team), it should be in version control even if the code is not yet ready or not using the perfect tool.  besides, it's free!

"By the way, has anybody seen the csv importation code lately? The one that actually made it to svn. Does it contain a single call to a Split() method?" - yes, the point is the time wasted when you two are doing the same thing differently which you both have no idea at that time.

"I always wondered why you decided to work on csv imports/display when we were assigned to do separate tasks. It cost time by you not working on your module" -  i did not work on any import, i said i saw both of your codes as you both asked me for some help at your desks so the rant was just my observation.

"it went against the skills training of the jr guy by you thinking it througg for him." - i just led him to do it in the correct way to do it because he was asking me how to do things properly.

"The irony is the ASP.net version somehow got checked in with compile error. I dont think tdd is the only way to test code, but at least one should compile the code before it is checked in" - this is my fault, i did not setup our CI server early on because there was none available.  besides you also had problems checking in code which does not compile on our machines.  this should have been captured by the ci server which i set up before i left.

thanks for commenting!

# The Senior Menace said on August 2, 2007 3:57 AM:

Errata:  <br>

By "code your code..." i mean "compile your code..."

# The Senior Menace said on August 2, 2007 4:45 AM:

As a personal preference i dont check-in test code. Just because its free doesnt mean it doesnt come with a cost. Ive not yet even finalized the file names. To check it in would mean a lot of rework for me later on. Anyway its a personal judgement just as you have your own. Time is only wasted when the jr guy or the sr guy didnt learn anything about what theyre doing. Theres nothing wrong with doing things differently. It's an exploratory period, its natural to test things out. And besides, the task is simple enough for one person to do. The team lead assigned the jr guy to me not so much for help but for training. If the jr guy is made to do redundant tasks, its not w/o a reason. Youre right, i too am guilty of checking-in code that broke a build (which i do quite often if i may say), but i fix it the moment i find out about it. And its mostly because of new files i forgot to check in. The asp.net code stayed broken for more than a week until i had to replace it because we needed to do a demo. Anyway, on a personal note, i have a lot of respect for you as a fellow senior developer and a work mate. If theres something sour about this whole thing is that the rants useem to have unfairly (wittingly or unwittingly) made a bad person out of me. You will probably not know the things i did just to make that project a better one. For one i was probably the first person to inform the team lead how bad the existing design was. Thats why we had a reenginering project in the first place. I always (and still does) welcome your feedbacks just as i direct them to you personally about things i dont like about the code or the design. By the way, how do you format these blog text into paragraphs anyway?

# jokiz said on August 2, 2007 7:14 AM:

"Ive not yet even finalized the file names. To check it in would mean a lot of rework for me later on. Anyway its a personal judgement just as you have your own." - i respect your view on this, but note that subversion stores history of files even when you renamed it, :p.

"Time is only wasted when the jr guy or the sr guy didnt learn anything about what theyre doing. Theres nothing wrong with doing things differently. It's an exploratory period, its natural to test things out. And besides, the task is simple enough for one person to do. The team lead assigned the jr guy to me not so much for help but for training. If the jr guy is made to do redundant tasks, its not w/o a reason." - point taken on your explorations on csv parsing.  same reason why i was surprised when jr guy was doing it in asp classic, so i introduced him on how to do it using repeaters and gridview, to train him.

"Youre right, i too am guilty of checking-in code that broke a build (which i do quite often if i may say), but i fix it the moment i find out about it. And its mostly because of new files i forgot to check in." - you know why?  because you disabled AnkhSVN which should be the one to automatically add the files to subversion when you add new files to the project. i was surprised why the jr guy has ankhsvn disabled too and i found out you advised him to.

"The asp.net code stayed broken for more than a week until i had to replace it because we needed to do a demo." - i'm not aware of this, you should have confronted the jr guy who did it since he was ranting to me that you replaced his code with the asp classic style.

"If theres something sour about this whole thing is that the rants u seem to have unfairly (wittingly or unwittingly) made a bad person out of me" - sorry about this but this post was to share my reader my experiences with work and at the same time raise argument with them for a discussion if ever there are some points that i view differently from theirs.  this is not meant for officemates or bosses to read, :p.

"I always (and still does) welcome your feedbacks just as i direct them to you personally about things i dont like about the code or the design." - I also did direct to you both items that apply to you (2 and 3).  #2 i asked you why not use subversion, #3 i asked you why do it in asp classic way, i even asked you to choose between classic or the asp.net way for our implementation.

"By the way, how do you format these blog text into paragraphs anyway?" - double line breaks will do (html disabled, drop your <br/>'s)

# The Senior Menace said on August 2, 2007 7:21 AM:

@Jon Limjap.. on NIH First: Split() is not what i can claim as my own csv parser; Second: im the one who told you about how cool the csv parser tool i found on the net that treated csv files as stream object. i was looking for csv parsers even before i told you about it. Third: I have an old habit of understanding what my needs are before i go forth and look for a tool. I have been burned countless times by 3rd party tools not delivering on what theyve promised. Nothing's wrong with using a 3rd party library/tool just as long as you know why youre using it. The sin is when one continously use them when theyre no longer needed. Fourth: I hope time will never come when one should have to regulate intellectual curiousity and creativeness.

# Jon Limjap said on August 2, 2007 10:10 AM:

Just to let both of you know, I also disable my AnkhSVN because it hangs my VS, but I have little or no problems with doing manual adds in Subversion because I made it a habit to diff the files that I'm going to commit.

I usually do this to check if I'm committing any "test aka trying-it-out" code, or commented code (everyone knows how I hate those). So I see which files haven't been added yet. It doesn't take too much time because I commit few files at a time often -- at least most of the time.

Maybe that could help

# Jon Limjap said on August 2, 2007 10:24 AM:

Senior guy,

Point taken -- however, most of the time you have to be realistic, take a step back, and think: hasn't someone else solved this problem before? Someone must have addressed this and posted their solution somewhere.

I'm not saying that we should rely on 3rd party solutions all the time, but we could take time to check some of them out (especially the open source ones), see if they fit our needs, see if they work, get rid of them if they don't. Especially if the problem is something like CSV parsing, complete with all its caveats.

And I do remember telling you to "not reinvent the wheel"... I'm now not sure which came first, the 3rd party tools or me telling you that :P

It's nice to explore our intellectual curiosity and creativity, but there's also the need to be pragmatic and prudent, especially when you're on a deadline :p And I think I've heard the boss tell you once to not treat everything as an academic exercise.

I hope you don't misconstrue our intentions here: we're merely sharing what we think is the best for all of us devs. That includes you. ;)

# The Senior Menace said on August 2, 2007 4:12 PM:

@Jon Limjap

There's a difference between understanding the problem and reinventing the wheel. I used a fine and existing csvReader wheel. Is that a snipe at the customized expression evaluation we've been using? :P

I think satisfying our intellectual curiosity and expressing our creativity is not merely nice, but an intrinsic need. Why else would jokiz ponder upon the number 29 in generating hash codes. or why would I write a number-to-words script using SQL, or why would anyone try to fix a working code.

The Boss asked the *whole group* not to "treat everything as an academic exercise" in reference to the OOP class (which I refrained from attending) and as a reminder that the Project is a real application that's going to be used by real clients.

Is there any other way anyone can misconstrue a rant? Its alright, everybody's entitled to one. Thing is, I probably have more to rant about than any of you but I do my ranting on weekly meetings and group emails (and yeah, even source code comments!) where we can actually do something about them. Painting a bad picture of some dev however anonymous with half informed statements is hardly sharing what is best for us (which excludes the target dev).

# The Senior Menace said on August 2, 2007 11:54 PM:

(sorry jokiz, just one last shot..)

Training is one thing, spoon feeding is another. I dont believe in "training" somebody by spending a large part of the day sitting down with him showing the one "correct" way. And please, let's avoid speaking about correctness as if its something absolute. Id rather encourage someone how to think (inside and outside of the box) and make sound and independent decisions. They may not always be decisions I can agree with, but its better than parroting.

I know exactly why I dont use AnkhSVN. And its not because somebody told me so.

# jokiz said on August 5, 2007 7:58 PM:

ahh, if you're talking about those moments where we paired using test-driven development, it's training in my vocabulary, besides, i let him drive the keyboard (no mouse, :p) 80% of those times.

# jop said on August 5, 2007 8:50 PM:

Junior Guy (or is it Junior Menace), if you are reading this, you are also free to butt in. I'm also eager to know what's on your mind, or, judging from the comments made by your collegues, what's not (yet) in it. :D

# DotNET @ Kape Ni LaTtEX » Blog Archive » When TDD goes red said on August 9, 2007 4:36 AM:

Pingback from  DotNET @ Kape Ni LaTtEX  &raquo; Blog Archive   &raquo; When TDD goes red

# http://devpinoy.org/blogs/joeycalisay/archive/2007/07/20/we-re-moving-backwards.aspx said on March 25, 2008 1:24 AM:

Pingback from  devpinoy.org/.../we-re-moving-backwards.aspx

# Propecia. said on July 11, 2008 4:23 PM:

Propecia.

# Zolpidem. said on August 7, 2008 12:09 AM:

Zolpidem.