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
Cuntpunch
Oct 3, 2003

A monkey in a long line of kings

MisterZimbu posted:

- When an actual business requirement changes and you have to dig through all of your old tests and figure out which ones need to be modified

I'm not in a TDD environment right now, so I'm curious - wouldn't it be easiest if the change is a *change* and not an extension/reduction of requirements, to just make the change in the code and *then* see which tests start hollering that the output has changed? I mean is the TDD philosophy so strict that *everything* has to be done test-first? Because yes, I could certainly see that in a large enough, thoroughly tested enough, codebase finding the [n] tests that are affected by a change to a requirement *before* making that change in the code...would be a headache.

Adbot
ADBOT LOVES YOU

FlapYoJacks
Feb 12, 2009

baquerd posted:

Depends on the app. A simple, stand-alone RESTful microservice can be 100% automated testing and deployment.

Which wouldn't include some of the tests that can't be done by way of automation? :confused:

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.


Cuntpunch posted:

I'm not in a TDD environment right now, so I'm curious - wouldn't it be easiest if the change is a *change* and not an extension/reduction of requirements, to just make the change in the code and *then* see which tests start hollering that the output has changed? I mean is the TDD philosophy so strict that *everything* has to be done test-first? Because yes, I could certainly see that in a large enough, thoroughly tested enough, codebase finding the [n] tests that are affected by a change to a requirement *before* making that change in the code...would be a headache.

The problem is business requirements may ignore the boundaries of your 'unit' tests, yes. Ideally if you're good about setting up single points of control then it wouldn't be so bad. I think the problem is the bigger the code base gets the more effort is involved in having a code base tested with single points of control.

Are test cases generated or do you have a bunch of manual objects strewn around various test cases (which now need to be updated). For data changes static typing could help show you what you're change list is but not all changes are so clear.

But then, in the end of the day the tests is code that ensures the requirements are met. If requirements change so do the tests. No getting around that.

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

MisterZimbu posted:

- I'm 100% convinced that there isn't a good way to do tests against a real database
I posted a project earlier that I think does testing fairly well with a database. Here's some scaffolding and JUnit tests that under the hood create a Hadoop cluster using a temporary folder along with well-defined configuration parameters. While you shouldn't test against a real, live production database directly with your automated tests, there's a lot of room between "feel good" useless tests against databases and full-blown deploying an entirely new production-class database with Puppet / Chef every time you run tests via Jenkins.

However, I believe that there isn't a good way to do 100% of tests against a facade / freshly stood up database because some bugs we have in our software is triggered by changes to software outside our control. For a gross example, repeatedly setting up a MySQL server using InnoDB and testing against it won't be enough to identify bugs if your customer happens to use MyISAM. Many more subtle error conditions exist between what your test cases' ideas of "production" assume compared to what happens out in the world. The goal of testing IMO isn't to eliminate all those known-unknown cases as much as to increase confidence in what you do support and know about.

Cuntpunch posted:

Because yes, I could certainly see that in a large enough, thoroughly tested enough, codebase finding the [n] tests that are affected by a change to a requirement *before* making that change in the code...would be a headache.
I've heard there's some advanced test coverage tools that will be able to help identify which parts of code are at risk when changing some tests since helping you find a bug if a test fails is closely related to such a feature.

Series DD Funding
Nov 25, 2014

by exmarx

Storysmith posted:

As someone who QAed things where the devs insisted tests passed but the feature itself (or unrelated features you'd see along the way, like "logging in") was hilariously broken, I'm in agreement.

In what situation would logging into a system have to be done through manual testing?

JewKiller 3000
Nov 28, 2006

by Lowtax

MisterZimbu posted:

- I'm 100% convinced that there isn't a good way to do tests against a real database

why in the world not?

code:
begin;
do whatever the hell you want here
rollback;

Storysmith
Dec 31, 2006

Series DD Funding posted:

In what situation would logging into a system have to be done through manual testing?

CSS changes made the button super hard to find / the text field white on white, was one of them. There's pixel-comparison automated tests out there, but I haven't heard great things about their stability or efficacy. Selenium wouldn't see either of the two issues because computer can still find the text field and shove characters into it and click the (roughly two pixel square) button.

Vulture Culture
Jul 14, 2003

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

baquerd posted:

Depends on the app. A simple, stand-alone RESTful microservice can be 100% automated testing and deployment.
Generally. I would caution that declarations like this run the risk of running into recursive definitions or "no true Scotsman" situations. If it can't be tested automatically, it's not simple!

There's lots of integration points where things fall over in unexpected ways and get fixed afterwards, but basically never have regression tests added because even though they're trivial cases to automate, they're painful on the system. One example: most test suites for a simple RESTful microservice don't check what happens if an upstream service responds to a request with one byte per second for 300 seconds. Does the application time it out? Does the OS time it out? Who knows! :shrug: :shobon:

Zaxxon
Feb 14, 2004

Wir Tanzen Mekanik

JewKiller 3000 posted:

why in the world not?

code:
begin;
do whatever the hell you want here
rollback;

what if you have transactions in your "do whatever" block?

Pie Colony
Dec 8, 2006
I AM SUCH A FUCKUP THAT I CAN'T EVEN POST IN AN E/N THREAD I STARTED
What database implementations supporting nested transactions don't allow you to roll back everything in the outer transaction's scope?

necrobobsledder
Mar 21, 2005
Lay down your soul to the gods rock 'n roll
Nap Ghost
I had integration tests against databases or an enterprise product installation snapshot a VM and rollback before. Nowadays, I might use Docker containers or ZFS snapshots to do it far faster and potentially in parallel.

Some database using tests that rollback would be invalid IMO.

Space Kablooey
May 6, 2009


Pie Colony posted:

What database implementations supporting nested transactions don't allow you to roll back everything in the outer transaction's scope?

First time that I've heard of nested transactions.

ChickenWing
Jul 22, 2010

:v:

Today I learned what it looks like when a git merge commits messy suicide.


Actually it was more like a branch was just sorta drawn and quartered over a series of 10-15 commits and merges.


I have no idea what the gently caress happened and my brain feels like a fully extracted tube of toothpaste after trying to decipher the whole goddamn mess. It's like our universe combined with an alternate universe where all my work on a particular API never happened.

Hughlander
May 11, 2005

ChickenWing posted:

Today I learned what it looks like when a git merge commits messy suicide.


Actually it was more like a branch was just sorta drawn and quartered over a series of 10-15 commits and merges.


I have no idea what the gently caress happened and my brain feels like a fully extracted tube of toothpaste after trying to decipher the whole goddamn mess. It's like our universe combined with an alternate universe where all my work on a particular API never happened.

Sometimes you just gotta know when to apply:
code:
git merge --abort
git rebase --interactive
git merge
git merge --ff-only
In the right orders...

ChickenWing
Jul 22, 2010

:v:

Hughlander posted:

Sometimes you just gotta know when to apply:
code:
git merge --abort
git rebase --interactive
git merge
git merge --ff-only
In the right orders...

Luckily, I have a tech lead for that.

For the rest of us, it was "git checkout <branch before it died>-temporary"


which admittedly still took half the day to get working properly :shepicide:

toiletbrush
May 17, 2010

leper khan posted:

I'm firmly in the test after group, but I also write all my interfaces down on paper and then furiously draw arrows and scribble until it makes sense. I think the issue is that most people don't spend a couple minutes thinking through their design before they just start writing piles of garbage.
These days I tend to write code from the top down and write tests later, because then my interfaces automatically match the hand-crafted artisanal API I'd expect to use if the functionality already existed. Write the code how I think it should look, asking the class that I think should be responsible (or creating it), alt-enter to create the methods, rinse and repeat with a bit of refactoring. This doesn't work for everything, of course, and you still need to think ahead to how things should look as a whole.

My current project has fairly low unit test coverage, 40% mebe, as the vast majority of units are really simple. The complexity we need to test comes from how they are composed, which isn't necessarily done via code, so we have loads of end-to-end tests written with specflow instead. So far it's worked really well, we've had literally zero bugs in production since we launched a few months ago, and the code's a total doddle to work with.

Ruzihm
Aug 11, 2010

Group up and push mid, proletariat!


toiletbrush posted:

hand-crafted artisanal API

Is this like hand-crafted artisanal toilet paper?

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





toiletbrush posted:

These days I tend to write code from the top down and write tests later, because then my interfaces automatically match the hand-crafted artisanal API I'd expect to use if the functionality already existed. Write the code how I think it should look, asking the class that I think should be responsible (or creating it), alt-enter to create the methods, rinse and repeat with a bit of refactoring. This doesn't work for everything, of course, and you still need to think ahead to how things should look as a whole.

you can still write tests first doing this, just stub out the unimplemented parts that have static returns.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
More tales (or is it tails here?) from Dinosaurland:

We wanted to create a web portal to expose to end users all the stuff we have. They can search for and select things they want from it that would go in a virtual shopping cart. That way, they can get it all at once at the end after aggregating everything together. I now have to entertain the whims of the dinosaur that didn't want to use TeamCity because "it's Java." Also, he has a "superior" solution using cron and autotools. I was thinking that given our organization's experience, we could use Django or ASP.NET. I expect when I brought up the activity with him that he'd want to use a LAMP stack because that existed before 1999--the magic year after which this guy thinks everything is poo poo. I mean, he won't say that, but it just works out that way. Okay, he was partially receptive to Markdown, which was invented in 2004 or something, but only because it reminded him of something older.

So yes, he wants a LAMP stack. Okay. The P there can mean many things. I assumed he wanted to use Perl, which would make my puke a little.

He wanted to use PHP. loving PHP. For a new project. Nobody else here does PHP. It's either C# or Python. Well, he has a framework for it he wrote already that can do the basics in a day. Somehow, I'm even less reassured. He volunteers to write it all. I don't volunteer to plug up its hemorrhaging butthole when it eventually bursts.

Well, Django and ASP.NET have the basics to do it in a day too. But ASP.NET is Microsoft, so that's a no-go. Remember that the dinosaur is the personification of a Slashdot poster from 1999. Django is bad because he worked in web hosting for 10 years and "you own everything you put up there--including the entire framework." Me? I'd much rather by glomming through Django to figure out when something went wrong rather than 10,000 lines of some god-knows-what PHP framework that I am quite sure is a far cry from an MVC pattern. Oh and what about more difficult use cases? Well, we will talk about that after we implement the 80% necessary stuff in PHP. At that point, we will just pray nobody wants to do anything more with it since I'm sure that framework will fall on its rear end. Meanwhile, a Django implementation would be eating it for breakfast.

My life.

My Rhythmic Crotch
Jan 13, 2011

Rocko Bonaparte posted:

which would make my puke a little.

plug up its hemorrhaging butthole when it eventually bursts.
Medical software by any chance?

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

My Rhythmic Crotch posted:

Medical software by any chance?

Nope--I have been marooned on the Planet of the Electrical Engineers.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

My Rhythmic Crotch posted:

Medical software by any chance?

Medical software companies like to pick some combination of "microsoft as gently caress", "let's build our own programming language", "web based client assuming you install a bunch of activex controls in IE."

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.
Everything made after 1999 is terrible. It's just that everything made on or before 1999 is also terrible.

PHP has maintained MVC frameworks. I wouldn't use them, because PHP, but they're there.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

leper khan posted:

PHP has maintained MVC frameworks. I wouldn't use them, because PHP, but they're there.
Sure, but what are the chances his framework is MVC?

necrobobsledder
Mar 21, 2005
Lay down your soul to the gods rock 'n roll
Nap Ghost
I've always wondered how industries that are supposedly crazy about security and compliance have used so much software that's known to be anything but good at security. I'm talking ColdFusion, Flash, PHP among so many DoD projects I've worked on as well as in healthcare. You'd think that if a vendor came along with a solution written in PHP in its early stages you'd pretty much ask for a rewrite to another platform / language before you got too far in, but I guess short-term thinking pervades even supposedly long-term thinking businesses.

ultrabay2000
Jan 1, 2010


If you're not retarded and you're using PHP in 2016 you hopefully are using Laravel or something similar. I think most of the current major frameworks are MVC so if he's not using one of those the problem is him not PHP. Even older prevalent frameworks like Codeigniter were still MVC oriented.

Gounads
Mar 13, 2013

Where am I?
How did I get here?

necrobobsledder posted:

I've always wondered how industries that are supposedly crazy about security and compliance have used so much software that's known to be anything but good at security. I'm talking ColdFusion, Flash, PHP among so many DoD projects I've worked on as well as in healthcare. You'd think that if a vendor came along with a solution written in PHP in its early stages you'd pretty much ask for a rewrite to another platform / language before you got too far in, but I guess short-term thinking pervades even supposedly long-term thinking businesses.

Major generalization here... The types of people who would pick those platforms are the types of people who would have the same problems on any platform, so a rewrite would just cost more.

Real problem is how those industries tend to choose vendors.

JawnV6
Jul 4, 2004

So hot ...

necrobobsledder posted:

You'd think that if a vendor came along with a solution written in PHP in its early stages you'd pretty much ask for a rewrite to another platform / language before you got too far in, but I guess short-term thinking pervades even supposedly long-term thinking businesses.
I don't understand conflating platform choice with short/long term thinking. With how many vendors have you had success asking for a ground-up rewrite outside their core competency?

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



JawnV6 posted:

I don't understand conflating platform choice with short/long term thinking. With how many vendors have you had success asking for a ground-up rewrite outside their core competency?

I do know a guy who said he was knowingly trading short turnaround time for future tech debt when he picked LAM(PHP) for his new startup. This was ~07, I think.

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

JawnV6 posted:

I don't understand conflating platform choice with short/long term thinking. With how many vendors have you had success asking for a ground-up rewrite outside their core competency?
When facing two vendors using different platforms and almost identical capabilities, perhaps picking the vendor that has a solution in a language that will not result almost certainly in project delays via operational issues due to frequent critical security problems is probably a forward-thinking decision. Literally putting security as an after-thought is against the principles of most DoD contracts as well. Specific to federal contracts, every other contractor will hire some random engineer that knows a language if they expect to inherit a codebase they don't know in-house already - you don't list platforms and languages under "capabilities" as a contractor to the US government, you put down non-technical things typically in your bid.

Re-writes are sometimes suggested by a vendor because they literally wrote demo-ware never meant for production, it's early enough into the SDLC, and customer success matters for your success. I was working with a vendor that was eating the cost to rewrite a Flash application into HTML5 because of concerns about Flash application security in a SCIF, finding a Flash developer when the previous ones had quit, and how much being gated by Flash plugins would hurt the business that depends upon demoing often to keep visibility to NCOs (read: VC partners).

Final decision by customer was to forbid / scrap the HTML5 effort (they were not being charged, reminder - this is also technically illegal I believe in hindsight, but that's another matter) and keep demoing the Flash version that still had bugs. I believe someone mentioned concern that if it looked different that red flags would be raised of a bait & switch. In any case, this may not be a reasonable example given that the wider effort was so egregiously mismanaged that it's under congressional investigation into 10 figures of misappropriation.

FamDav
Mar 29, 2008

Munkeymon posted:

I do know a guy who said he was knowingly trading short turnaround time for future tech debt when he picked LAM(PHP) for his new startup. This was ~07, I think.

whats zuckerberg up to these days

spiritual bypass
Feb 19, 2008

Grimey Drawer

Munkeymon posted:

I do know a guy who said he was knowingly trading short turnaround time for future tech debt when he picked LAM(PHP) for his new startup. This was ~07, I think.

This was before PHP had namespaces, so that's some serious technical debt. Nowadays it's pretty easy to write well-organized PHP like you would in any other language but most people still don't

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



FamDav posted:

whats zuckerberg up to these days

AFAIK that's who he works for nowdays :v:

revmoo
May 25, 2006

#basta
How do the job listings in everyone's cities look? Right now there are less development postings in my city than I've EVER seen, including during the recession. I ran a quick search on a variety of languages that are popular here and I'm actually coming up with zero listings for a lot of stuff like Ruby/Rails, when there would be literally tens or hundreds before. Even C# which is huuuuuuuge in this city has like 10 jobs and most of them are repeats or incredibly stale.

I'm still managing to book interviews but I'm having to really dig this time around and it's a little concerning. Is it just because we're towards the end of the fiscal year or is something else going on?

Riven
Apr 22, 2002
Probably. Budgets reset beginning of year. Still tons of jobs in Denver!

Huzanko
Aug 4, 2015

by FactsAreUseless

revmoo posted:

How do the job listings in everyone's cities look? Right now there are less development postings in my city than I've EVER seen, including during the recession. I ran a quick search on a variety of languages that are popular here and I'm actually coming up with zero listings for a lot of stuff like Ruby/Rails, when there would be literally tens or hundreds before. Even C# which is huuuuuuuge in this city has like 10 jobs and most of them are repeats or incredibly stale.

I'm still managing to book interviews but I'm having to really dig this time around and it's a little concerning. Is it just because we're towards the end of the fiscal year or is something else going on?

Business has slowed unprecedentedly at the consultancy I work for. I'm pretty sure it's the election.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Noam Chomsky posted:

Business has slowed unprecedentedly at the consultancy I work for. I'm pretty sure it's the election.

Business is slow for my firm, too, and this has been my assumption, but I'm biased because I love watching the quadrennial dumpster fire burn.

Huzanko
Aug 4, 2015

by FactsAreUseless

Munkeymon posted:

Business is slow for my firm, too, and this has been my assumption, but I'm biased because I love watching the quadrennial dumpster fire burn.

I think a lot of companies are looking at our orange haired apocalypse the same way that they did at Brexit. Not a good time for long-term decision-making.

return0
Apr 11, 2007
Am personally hoping it's the bubble bursting as liquidity dries up with rising interest rates, so we all face horrible hardship.

Adbot
ADBOT LOVES YOU

Huzanko
Aug 4, 2015

by FactsAreUseless

return0 posted:

Am personally hoping it's the bubble bursting as liquidity dries up with rising interest rates, so we all face horrible hardship.

That's probably it, too, tbh. I'll see you all in the Foxconn factory where we'll all be working inside of a year to make incrementally different platinum iPhones for all of Mitt Romney's children.

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