What is the largest amount of code you added before testing/running anything?
-
Sitting at my desk right now and realized I added 429 lines of code over the past two days and I haven't tested any of it outside of examples from stack overflow... What is the largest section of code you added before a running anything and how did that turn out for you?
[spam edited in, after post was released, removed - @PJH]
-
@guddduidharaah I don’t know about line count (although if you include tool-generated code it’s way higher than 429 lines!), but I definitely wouldn’t go two days without running it...
-
Back when I was wetter around the ears I would easily go a day or so and a thousand lines or so of code before testing it. These days I run unit tests when it's back to compiling again.
-
Not very much at all. Maybe 10 lines, more if it's copy-pasted (which happened more earlier in my career). My development style totally relies on the debugger. I'll make a change, see how far it gets, make another change, etc.
-
I try to keep it to a minimum, since the bigger the change the harder it is to find out what broke. That said, I'm pretty sure I've done multiple thousands of lines of diff in a refactor before things compiled again.
-
My 9-person team has spent 3 months on this one feature, and while we had the spec (kinda) and it passed our own tests in our own (read: not exactly accurate) simulated environment, we've had no idea how it behaved on real hardware. After all code has been merged into master branch and task marked as complete, it took a couple more months until proper testing started and we knew for sure if it worked (spoiler: it didn't). So if you take this stripped down definition of "testing/running anything", the largest amount of code we've added untested was roughly 3,000 man-hours.
-
I've been working on rewriting a wrapper library to support the new version of the API it wraps, where the methods and parameters have all changed. At first, we couldn't get the server with the new version running properly so while waiting for it I changed every call to my best guess for the new API. That was around 1000LOC but it was mostly copy pasting the old version and changing the API calls. Once I had the environment up and running and started adding unit tests it unsurprisingly ended up needing a lot of work to pass.
-
Well the entirety of my go program is technically untested. Granted, it's less than a hundred lines...
-
All of it.
-
@loopback0 said in What is the largest amount of code you added before testing/running anything?:
All of it.
Haha, perfectly pedantic, I love it!
-
@Tsaukpaetra I wasn't going for pedantic, just a rubbish joke.
-
Thousands of lines. I do it regularly.
Write all I have to write, whole feature, whole library, etc. Then test.
Never had any problems with this approach.
-
@guddduidharaah Welcome to the forums!
-
@pie_flavor looks like a project that used to not use version control, introducing version control after it was mostly finished. I'm sure there was lots of running and testing before July 2017.
-
Is nobody going to mention the random trio of links at the bottom of a user's first post?
-
@Gąska No, more of a direct port of a fix-all-the-red-underlines variety.
-
@kazitor Nah, the mods'll handle it.
-
@kazitor said in What is the largest amount of code you added before testing/running anything?:
Is nobody going to mention the random trio of links at the bottom of a user's first post?
What links, that were added in by the OP, after the post was released?
It's been taken care of.
-
@PJH If that was an edit, that explains why nothing had happened. All good then.
-
I was adding scripting to an application once upon a time. This involved adding tons of scaffolding to go between COM+IDispatch and the application's internal command system, on the order of thousands of lines in multiple files. Until enough of it was complete I couldn't test hardly any of it. I could compile, but the entire mess couldn't do anything until most of it was done. After that point, though, it went rather quickly.
The unfortunate part: due to a combination of poor implementation decisions on my part and the foibles of Visual C++ 6, I doubled or tripled the time it took to compile. There was also some existing code I should have thrown out that made debugging a PITA, but that only caused me problems, not the whole team.
-
That has to be back when I was working on that codethulian mess of C++, since unit tests didn't exist, and as a greenhorn, I could just not make the effin things work. And my local server had gone tits up, so I had no way of testing on my machine, and there were a buch of very upset clients breathing down the managers necks about this and that... So, pretty much the normal work day.
But I once did a full feature of thousands of lines of fucked up C++ entirely without tests and shoved it into trunk.
That place actually did have some form of QA before releasing to the wider world, unless it was something that was extremely important. Then the managers even asked for testing to be skipped entirely to make development happen faster.
I learned a few very valuable lessons at that place.
-
@Carnage said in What is the largest amount of code you added before testing/running anything?:
fucked up C++
-
4294967296. I never do uint testing.
-
@Applied-Mediocrity said in What is the largest amount of code you added before testing/running anything?:
I never do uint testing.
or proof reading?
-
@Luhmann all his testing is with signed ints
-
@Luhmann said in What is the largest amount of code you added before testing/running anything?:
@Applied-Mediocrity said in What is the largest amount of code you added before testing/running anything?:
I never do uint testing.
or proof reading?
That's boring. Proof writing is more fun.
-
@boomzilla Maybe he just goes for the 80% proof?
-
@dkf of course. Proof drinking is the best.
-
@Jaloopa said in What is the largest amount of code you added before testing/running anything?:
@Luhmann all his testing is with signed ints
That way you know it's secure!
-
@dkf said in What is the largest amount of code you added before testing/running anything?:
80% proof
*twitch*
-
I once wrote a .c file that compiled and ran properly on the first try.
-
@anonymous234 said in What is the largest amount of code you added before testing/running anything?:
I once wrote a .c file that compiled and ran properly on the first try.
Hello World doesn't count.
-
@anonymous234 said in What is the largest amount of code you added before testing/running anything?:
I once wrote a .c file that compiled and ran properly on the first try.
int main(void) {}
-
This is how I write any decent-sized feature: write (almost all of) it, then try running it. Then spend a while debugging it. I'm honestly not sure if this is better than debugging-as-I-go: most of my code simply works as-is. So most of the time, testing the code-I-just-wrote is just going to spend time confirming that stuff works fine.
The question is whether the time I spend debugging at the end of a long coding session is bigger or smaller than the sum of the time spent on the smaller debugging sessions if I debugged-as-I-went. But my debug-later process works for me, so I go for it.
(I do mostly web-dev work that heavily depends on a running back-end. Said back-end is occasionally slow, so some of my debugging sessions can also be a bit slow, which is simply frustrating. If I find a bunch of bugs all at once when debugging at the end, then I don't need to refresh/rebuild as often.)
-
@mikehurley I'll have you know it had like, four different functions at least.
-
@dkf said in What is the largest amount of code you added before testing/running anything?:
80% proof
Indicating 40% ABV, because if you're saying percent proof you're saying how far of the way towards ignitable when poured over gunpowder, standard is 4/5 of the way there, couldn't be clearer.
@Gaska, it's valid. See above.
-
@anonymous234 said in What is the largest amount of code you added before testing/running anything?:
I once wrote a .c file that compiled and ran properly on the first try.
The real achievement is a .rs file.
-
@pie_flavor programmer does not live long enough.
-
@Gąska said in What is the largest amount of code you added before testing/running anything?:
@dkf said in What is the largest amount of code you added before testing/running anything?:
80% proof
*twitch*
I normally use %ABV like any sane person, but then the joke wouldn't have worked.
-
@MrL said in What is the largest amount of code you added before testing/running anything?:
Thousands of lines. I do it regularly.
Write all I have to write, whole feature, whole library, etc. Then test.
Never had any problems with this approach.
This has happened to me a couple of times: I write a whole new module. I run. Nothing happens, or it behaves as before.
Oops, forgot to add an actual call to the new code! Add it. Runs perfectly.*Working with a static language and syntax highlighting helps a ton. Reviewing the code before the first run also helps.
*If you look at it , all bugs are a variant of this "you didn't run what you were supposed to".
-
@PotatoEngineer said in What is the largest amount of code you added before testing/running anything?:
This is how I write any decent-sized feature: write (almost all of) it, then try running it.
When adding a feature to an existing system, test-first works extremely well. When doing green-field development (or converting from a thoroughly different language) it's very hard to write tests first because of the sheer quantity of code that has to be written in order to make things work at all; it's not always certain what the right places to test even are. I've written tens of thousands of lines of code without tests in exactly this case: the understanding of what testing was required was later.
Mind you, I always had in mind that testing would happen (and a pretty good idea what the integration/acceptance tests would involve) and the infrastructure to do the testing as part of the CI flow was there from pretty much the first commit. The code doesn't ship untested, it just has to be without tests for quite a long time while it is being brought up to the point where testing makes sense.
-
@dkf said in What is the largest amount of code you added before testing/running anything?:
@Gąska said in What is the largest amount of code you added before testing/running anything?:
@dkf said in What is the largest amount of code you added before testing/running anything?:
80% proof
*twitch*
I normally use %ABV like any sane person, but then the joke wouldn't have worked.
You know, you could've just said 80 proof.
-
@Gąska That's not entirely 200 proof correct. The joke wouldn't have worked and it wouldn't have bothered anybody.
-
@Gribnit I try not to be too bothered by not understanding what you're talking about.
-
@Gąska You can't parse 200 proof correct? Obviously means "100% correct and inflammable".
-
@Gribnit said in What is the largest amount of code you added before testing/running anything?:
@Gąska You can't parse 200 proof correct?
No, I can't parse "the joke wouldn't have worked".
-
-
@Gribnit it absolutely is your fault. You said it.
-
@Gąska
No.
@dkf said in What is the largest amount of code you added before testing/running anything?:@Gąska said in What is the largest amount of code you added before testing/running anything?:
@dkf said in What is the largest amount of code you added before testing/running anything?:
80% proof
*twitch*
I normally use %ABV like any sane person, but then the joke wouldn't have worked.
-
@Gribnit and in that post, I see what he's talking about and why it would be so. But then you said that even if it was "80 proof", it would still kill the joke, and I just can't see how.