Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
Also, if unit tests are properly written, it should be very easy to figure out where any problems are occurring, instead of trying to trace down the specific broken functionality that's causing an error, especially if you have to go through a fair amount of effort just to reproduce the bug.

Ultimately, rules are made to be broken, though. Adhering to ideology instead of common sense is foolish.

Adbot
ADBOT LOVES YOU

CPColin
Sep 9, 2003

Big ol' smile.
I like when tests fail with the message "assertion failed."

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Hughlander posted:

You can manage that I think. Or at least prevent new ones from showing.

Ahh yes! Yes you can! And I just did!

("debugging" is now my most-vouched skill. =/)

necrobobsledder
Mar 21, 2005
Lay down your soul to the gods rock 'n roll
Nap Ghost
This is why you're supposed to use test libraries like Hamcrest matchers / JUnit 4 (in Java) perhaps RSpec or even Cucumber in Ruby land. Something that helps a little when it fails is better for future developers on the codebase. They're a pain in the rear end to write, unfortunately, but if you're doing Java you're not used to anything sane and terse now are you?

vonnegutt
Aug 7, 2006
Hobocamp.
I like testing. If it's for pre-existing (legacy) code, it helps me understand what's going on more than a read through does, because I'm checking my assumptions. If it's for my own code, it proves that I've done the thing I tried to do.

It becomes super annoying if I try to do them all after I write my code, so I use some form of TDD most of the time, but I'm not super strict about it. Integration tests / feature tests are more useful than unit tests, but they're harder to write properly (with isolating behavior from implementation as much as possible). I write a mix of both.

As with most work strategies, opinions on testing is reactionary. When I was on a codebase with something like 88% coverage, I was annoyed by the length of time the tests took to run, especially since most of them were super basic unit tests. Oh, get_username returns a string??? You don't say! There were still bugs, and we still had to write regression tests to cover edge cases that weren't covered.

However, now that I'm working on a codebase with zero tests, I'm feeling the pain of that. There are lots of functions that don't do what the name implies it should, or that have been mutated and now produce tons of side effects, possibly unintentionally (but who knows). Nothing is validated, and there's nearly zero error handling. Coming from my previous environment, it's a slow and arduous process to update any code, because there's no guarantee that any of it worked in the first place. I end up debugging old code more than writing new code.

Maybe testing isn't required for seasoned veterans who know about the common mishaps and avoid them instinctively. I'm not that secure in myself yet, so I'll continue to test.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

For me it's a LOC thing. Beyond some point, I can't keep the whole structure in my head or know what everything should be doing. If something breaks 2KLOC, I expect it to have better documentation and tests than if it's below that.

If something breaks 10KLOC without any tests or documentation, terrible things happened.

I generally don't bother writing tests for projects <1KLOC.


If a project has 1MM+ LOC and no tests find a new job I guess because it's not worth it.

Gounads
Mar 13, 2013

Where am I?
How did I get here?
Has anyone actually gotten to the point where a non-developer is writing test specs in something like gherkin and then that becomes the functional spec? I hear fairy tales of that happening but have never even been close to it.

withoutclass
Nov 6, 2007

Resist the siren call of rhinocerosness

College Slice

Gounads posted:

Has anyone actually gotten to the point where a non-developer is writing test specs in something like gherkin and then that becomes the functional spec? I hear fairy tales of that happening but have never even been close to it.

Yep, I worked with an internal testing automation team at one gig and I successfully pitched this, where our QA was writing their acceptance criteria in gherkin and then the automation folks took that and filled out the rest of the cucumber tests. It was pretty rad.

Gounads
Mar 13, 2013

Where am I?
How did I get here?
Were your automation folks the engineers implementing the features, or a team after?

ChickenWing
Jul 22, 2010

:v:


Ever since the day automated testing "clicked" for me, I don't see how it's possible to write a reasonably sized application without proper testing. It's so much simpler than having to manually test everything, and you can be so much more confident in your code when you have a suite of tests that make sure that it runs at least approximately correct. Plus, just the act of testing helps me critically examine my work and find little bits that I missed while developing.

It also makes refactoring orders of magnitude easier

necrobobsledder
Mar 21, 2005
Lay down your soul to the gods rock 'n roll
Nap Ghost

Gounads posted:

Has anyone actually gotten to the point where a non-developer is writing test specs in something like gherkin and then that becomes the functional spec? I hear fairy tales of that happening but have never even been close to it.
I've heard of program managers writing down contractual deliverables while a lawyer helps consult on the meaning, and the results of those notes turn into functional requirements that turn into Cucumber tests (because it works with Java). But I also heard they stopped doing it not because it wasn't effective but because the lawyer to help translate the legalese was getting too expensive (yes, the lawyer was paid more than the PM and two engineers by a significant margin, welcome to enterprise).

Gounads
Mar 13, 2013

Where am I?
How did I get here?

necrobobsledder posted:

I've heard of program managers writing down contractual deliverables while a lawyer helps consult on the meaning, and the results of those notes turn into functional requirements that turn into Cucumber tests (because it works with Java). But I also heard they stopped doing it not because it wasn't effective but because the lawyer to help translate the legalese was getting too expensive (yes, the lawyer was paid more than the PM and two engineers by a significant margin, welcome to enterprise).

I can't quite tell, is that sarcasm?

CPColin
Sep 9, 2003

Big ol' smile.
I saw somebody put into his test plan that he was going to test a certain class, probably because he saw it in the diff, but I jumped in and said, "You don't need to test this; the change is trivial and the compiler already verified it by not blowing up." He proceeded to approve the project, so I deployed it to Test, where he repeated the same steps and closed the issue.

Then, a few minutes later, edited into his closing comment that he tested that class.

Beef
Jul 26, 2004

necrobobsledder posted:

I've heard of program managers writing down contractual deliverables while a lawyer helps consult on the meaning, and the results of those notes turn into functional requirements that turn into Cucumber tests (because it works with Java). But I also heard they stopped doing it not because it wasn't effective but because the lawyer to help translate the legalese was getting too expensive (yes, the lawyer was paid more than the PM and two engineers by a significant margin, welcome to enterprise).

You also can't ask a lawyer to stay longer on a friday evening to crunch for a release deadline, he is a professional.

(edit: or she)

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

necrobobsledder posted:

I've heard of program managers writing down contractual deliverables while a lawyer helps consult on the meaning, and the results of those notes turn into functional requirements that turn into Cucumber tests (because it works with Java). But I also heard they stopped doing it not because it wasn't effective but because the lawyer to help translate the legalese was getting too expensive (yes, the lawyer was paid more than the PM and two engineers by a significant margin, welcome to enterprise).
I don't understand why they didn't just cut the lawyer out of this process

necrobobsledder
Mar 21, 2005
Lay down your soul to the gods rock 'n roll
Nap Ghost

Gounads posted:

I can't quite tell, is that sarcasm?
Second hand information from someone that tended to underestimate bureaucracy and process. By "lawyer" I think it was someone from GAO or the Pentagon's equivalent and another lawyer on the prime contractor side. Normally, these contractual obligations for technical deliverables are done back and forth across maybe a month or longer, and there was no SME present to make sure the scoping was sufficient enough for engineers to start somewhere (this was identified as a huge delay point on some projects before - engineers sitting with no requirements for 4 months while burning government money), so someone had demanded that this be done in a room with an SME as a stakeholder and that there's well-defined technical artifacts used as evidence of meeting requirements according to whatever arbitrarily useless definition of requirements that may be. This is part of how Structured Agile was supposed to start on that project and using some form of BDD tied back to line items on the contracts.

I've seen pure, crystalized bureaucracy so many times in DoD contracting that I don't even question dumbass stories involving only a couple millions of dollars lost, only when someone attaches about 8 zeros do I start giving a crap about whether it might be serious or not. I mean hell, when DHS literally builds a 10-story building for $50MM, uses it for a week to train some random new-hires and give some media presentations, and abandons it despite all the other millions on planning you know it's all just a public works project anyway.

Beef posted:

You also can't ask a lawyer to stay longer on a friday evening to crunch for a release deadline, he is a professional.
You can if the lawyer's on retainer or salaried with terms to allow exemptions like a lot of lawyers that work for government and corporations do.

Vulture Culture posted:

I don't understand why they didn't just cut the lawyer out of this process
More human intervention = greater concern in government projects, it's the culture of bureaucracy. The government has tons of stuff being put into contracts now to limit risk and so forth to try to actually penalize bad actor contractors and for better objective scrutiny of high tech projects due to the sequester as well as increased media attention, so I fully expect stories worse than that to show up while folks like USDS and 18F actually.... get work done.

withoutclass
Nov 6, 2007

Resist the siren call of rhinocerosness

College Slice

Gounads posted:

Were your automation folks the engineers implementing the features, or a team after?

Automation was basically back filling, so they were mostly filling out the rest of the tests to work against what was there. New features were built out by development where the gherkin would need to be passing in order to mark a story as complete.

In this way it was nicely separated, with QA writing out gherkin, development building out new features to pass gherkin specs, and automation making sure old features were covered.

pigdog
Apr 23, 2004

by Smythe

Gounads posted:

Has anyone actually gotten to the point where a non-developer is writing test specs in something like gherkin and then that becomes the functional spec? I hear fairy tales of that happening but have never even been close to it.
That's not quite how it should work. The business people, analyst, developer, and testers should work the specs out together, so that there is common understanding among all the involved parties about how the thing should work. The functional, automated spec form is a cool thing that also allows testing of that understanding to be automated, but the process of figuring it out and putting it on paper with everyone's input is really even more important. Not only common understanding, but importantly also shared responsibility, instead of "that's not what we wanted" or "but you said you wanted so and so".

Riven
Apr 22, 2002
Sure sure. Unless your company is rolling out a replacement for their old platform (that handles billions in revenue) and the new platform doesn't even have a product manager, so there's nobody to get all those people in the room. So QA just writes gherkins that sort of match something that could be expected, but the debts change the error messages every other week, and aren't actually aware of what QA is writing, so the tests are always failing.

The Leck
Feb 27, 2001

leper khan posted:

If something breaks 10KLOC without any tests or documentation, terrible things happened.
Yeah, I've run across this. In a single class. :smithicide:

ChickenWing
Jul 22, 2010

:v:

The Leck posted:

Yeah, I've run across this. In a single class. :smithicide:

:catstare:

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
How do you get up to 10KLOC in a single class unless your design is extremely subpar?

spiritual bypass
Feb 19, 2008

Grimey Drawer
Is that some sort of riddle?

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

PT6A posted:

How do you get up to 10KLOC in a single class unless your design is extremely subpar?

The answer is probably Minecraft modding. I saw a crash before from a class that had more byte code than the JVM allowed.

In a single method.

Che Delilas
Nov 23, 2009
FREE TIBET WEED

PT6A posted:

How do you get up to 10KLOC in a single class unless your design is extremely subpar?

You answered your own question.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Che Delilas posted:

You answered your own question.

Still, a 10KLOC class would seem to be the fruit of actual, purposeful commitment to terrible design, instead of something that just happens because no one was paying attention.

hailthefish
Oct 24, 2010

"I don't really know what classes are or how object-oriented programming works so I have one giant class named 'Program' and everything is inside it."

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

PT6A posted:

Still, a 10KLOC class would seem to be the fruit of actual, purposeful commitment to terrible design, instead of something that just happens because no one was paying attention.

"gently caress it, I'm not fixing that mess, I'm just getting in and out with my bug fix as fast as possible. Hopefully I am no longer here when the whole thing implodes."

baquerd
Jul 2, 2007

by FactsAreUseless

PT6A posted:

Still, a 10KLOC class would seem to be the fruit of actual, purposeful commitment to terrible design, instead of something that just happens because no one was paying attention.

You've never seen a math/physics PhD with one CSC101 course under their belt getting paid big bucks to write financial software? Cause that's how that happens, at least in my personal experience.

FlapYoJacks
Feb 12, 2009

Skandranon posted:

"gently caress it, I'm not fixing that mess, I'm just getting in and out with my bug fix as fast as possible. Hopefully I am no longer here when the whole thing implodes."

This; this is the correct answer.

- Some idiot creates a gigantic class of poo poo.
- Idiot leaves
- New guy gets stuck with gigantic class and BUGS ARE AFFECTING PRODUCTION!!!1!!!
- New guy never gets enough time to actually fix the class.

goto 1

FlapYoJacks fucked around with this message at 21:38 on Aug 26, 2016

CPColin
Sep 9, 2003

Big ol' smile.
Error: "1" not defined

KoRMaK
Jul 31, 2012



I kicked a bunch of stuff back to the junior on the team that didn't pass code review.

I do the same thing every week when i see him walking around the office and basically goofing off, "hey, could you do me a favor and make sure all the branches you wrote are production ready?"

Always says yes


I get the branches and its not dry, the test coverage is poor and its taken way too long to get even to this point.

He seemed bummed out that half his stuff went back, but this stuff is sure as poo poo not getting into production, my dude. Start implementing best practices more often.


The frustrating part is that I keep asking him if his stuff is all gonna pass review and he always says yes but then I see it and its like, dude you made a Rails 101 mistake on the first page wtf is your deal.

smackfu
Jun 7, 2004

I'm pretty sure our new product owner is just faking his way through Agile. He accepts stories without verifying them and he wants to have an IPM on an ad hoc basis as needed. And keeps confusing the ice box and back log.

Help me.

Gul Banana
Nov 28, 2003

what is an ice box?

necrobobsledder
Mar 21, 2005
Lay down your soul to the gods rock 'n roll
Nap Ghost
Pivotal Tracker has an icebox section that I've used for stories as a suggestion box before triage and can still be rejected. That's the only usage of an icebox I've seen in my agile project planning tools anyway.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

PT6A posted:

How do you get up to 10KLOC in a single class unless your design is extremely subpar?

Android PackageManagerService.java

20,935 loc

There's some fun stuff in AOSP

vonnegutt
Aug 7, 2006
Hobocamp.

Gul Banana posted:

what is an ice box?

We always used the icebox as the "we want to make sure everyone's ideas are heard and captured" but until they were promoted to backlog or better they did not get done. Theoretically our PM was supposed to review anything added to the icebox and promote the useful things, but that also never happened.

I have worked on a lot of teams that had four devs and fifteen "top priority, in progress" stories though, so take everything with a huge grain of salt.

smackfu
Jun 7, 2004

necrobobsledder posted:

Pivotal Tracker has an icebox section that I've used for stories as a suggestion box before triage and can still be rejected. That's the only usage of an icebox I've seen in my agile project planning tools anyway.

Yeah, I guess it is a Pivotal Tracker invention. In our case, anyone can add stories and bugs to the icebox but only the business owner can move them to the actual backlog and prioritize them.

Gul Banana
Nov 28, 2003

ah. we use a "submitted" state for that

Adbot
ADBOT LOVES YOU

The Leck
Feb 27, 2001

ratbert90 posted:

This; this is the correct answer.

- Some idiot creates a gigantic class of poo poo.
- Idiot leaves
- New guy gets stuck with gigantic class and BUGS ARE AFFECTING PRODUCTION!!!1!!!
- New guy never gets enough time to actually fix the class.

goto 1
Ding ding ding! And the lack of any tests/documentation mean that just leaving most of the mess alone is the (short term) safest course of action. Occasionally someone comes along and yanks out a section of code into its own class where it should be, but it inevitably causes subtle to catastrophic bugs in functionality that the well-meaning person working on it wasn't even aware of.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply