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
Subjunctive
Sep 12, 2006

✨sparkle and shine✨

LeftistMuslimObama posted:

we do not have unit tests. instead we have "test plan runners", which are dedicated QA staff that just spend all their time running through workflow scripts in the integration testing environment and reporting things they find that are broken. it works about as well as you would think.

I've used manual automation before while bringing test systems online, it's OK. Works especially well if the testers are far away, so that you wake up to the results for last night's build.

tyrelhill posted:

The QA staff at my old job didnt trust our unit tests (and retested the features themselves) so we just stopped writing them :cmon:

The point of unit tests is really to improve developer productivity, not to test features. Write tests for yourself, you're worth it.

Adbot
ADBOT LOVES YOU

Sedro
Dec 31, 2008

UraniumAnchor posted:

We have about 9000 JS unit tests and the only intermittent failures from those are when PhantomJS crashes randomly. :v:

Our e2e tests are a different story.
Until the recent version 2, PhantomJS never ran the garbage collector. Hope your entire test run fits into memory!

Munkeymon
Aug 14, 2003

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



Sedro posted:

Until the recent version 2, PhantomJS never ran the garbage collector. Hope your entire test run fits into memory!

That explains a lot of the problems I ran into using it as a scraper :\

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Subjunctive posted:

I've used manual automation before while bringing test systems online, it's OK. Works especially well if the testers are far away, so that you wake up to the results for last night's build.

At what scale? Because the issue here is that for a given division (around 50 devs, typically), there's 1 test plan runner. All the other QA staff test specific changes only, rather than broader workflows. It just doesn't work that well. There's an effort to create a unit test framework, but it's difficult to bolt that into MUMPS at all, much less when you have a 20+ year old codebase where a lot of code was written as monolithic routine with no real division of responsibility. The idea of trying to keep functions down to a single screen in size didn't catch on here until the late '00s from what I can see.

UraniumAnchor
May 21, 2006

Not a walrus.

Sedro posted:

Until the recent version 2, PhantomJS never ran the garbage collector. Hope your entire test run fits into memory!

This explains so much.

qntm
Jun 17, 2009

LeftistMuslimObama posted:

we do not have unit tests. instead we have "test plan runners", which are dedicated QA staff that just spend all their time running through workflow scripts in the integration testing environment and reporting things they find that are broken. it works about as well as you would think.

We were in a similar situation at one point. Eventually what I did was set up a copy of that integration testing environment with proxies wrapped around all of the relevant interfaces which dumped copies of all the input and output data to files, then told the QA people "Run your manual tests now against this environment". Then I gathered up all of the files and used their contents as unit test data.

We were actually porting that application from one platform to another and the original authors were terribly concerned about performance. Of course they had no performance tests or data either.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

LeftistMuslimObama posted:

At what scale? Because the issue here is that for a given division (around 50 devs, typically), there's 1 test plan runner.

We had some unit tests as well, but I think that was roughly our ratio. We also made heavy use of internal dogfooding (about half our employees are running the daily build), which helps a lot.

E: actually, was more like 20:1 I think.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Subjunctive posted:

We had some unit tests as well, but I think that was roughly our ratio. We also made heavy use of internal dogfooding (about half our employees are running the daily build), which helps a lot.

Unfortunately, a "build" isn't a thing for mumps. Our setup is roughly like this:

4 primary development servers. 1 where you do initial dev, 1 where you do a first code review and QA pass, another 1 for a second pass of review and QA, and a packing environment. You do all your coding in the first environment, making it inherently the least stable of the 4 because everyone's changing poo poo constantly. Running unit tests against it is basically worthless because having things work right would be pretty exceptional. Once you're done with your changes, you move them into the second environment using a tool built into Cache that basically exports your routines to a flat file. You diff your flat file with a flat file from the second environment and resolve any conflicts, than import the resolved flat file into the second environment. This environment should be slightly more stable as the things here are nominally "done". Same process to move to testing 2. After that, your things go into the final packing environment through the same process, and it's assumed that if it's there it's ready to release.

When I say environment, I literally mean "standalone Linux server running Caché". SVN isn't feasible in a sane manner because all MUMPS source code is stored as data within the Caché database itself. You can see your code (both raw and compiled) in data globals within the database. We keep server code in SVN, but only in the sense that when you do that export-import step the flat file gets committed to an svn repo for that environment. Storing the code inside the database wasn't our idea, it's a "feature" of the platform.

What this effectively means, though, is that you have 4000 developers working out a single environment (which you could consider the "daily" build, I suppose), and then 1500ish QAers testing out of two environments that are each slightly more stable than the last.

The end result is that it's really hard to tell when poo poo is broken just because you're in a less stable environment or because something was specifically broken by a recent change. Especially because there's so much code that has all sorts of crazy side effects on global state, this means even if you thoroughly regression test your feature, you can still end up loving up something completely unrelated that goes unnoticed for a long time.

The ideal would be to refactor a lot of code to be actually unit testable, but that's always a hard sell when your customers are demanding specific enhancements and fixes and you only have so many developers. A big part of my job is literally just knowing how to cope with living inside of a coding horror and still getting things done the right way where I can. We can't even migrate to a new platform that doesn't have all these problems because our customers have serious sunk-costs fallacy syndrome w/r/t what they've invested in standing up and maintaining Caché environments and they get really upset if we talk about using a different database.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨


God bless.

Wardende
Apr 27, 2013
code:
// Add two hours to end date of promotion to account for possible daylight savings times (easier to implement)

Slanderer
May 6, 2007

Wardende posted:

code:
// Add two hours to end date of promotion to account for possible daylight savings times (easier to implement)

I like their style.

kloa
Feb 14, 2007


I mean, it's better than storing datetimes as a string :smithicide:

Evil_Greven
Feb 20, 2007

Whadda I got to,
whadda I got to do
to wake ya up?

To shake ya up,
to break the structure up!?
Apparently, there is an SQL database that is 'performing slowly' and needs improvement.

It seems that someone who didn't know SQL was long ago tasked to pull data from it based on a date range.

This person decided to iterate through rows with the little SQL he knew, one at a time, copying into a new table the rows within the date range - until it runs out of rows and throws an exception.

This exception is caught, purposely allowing the program to continue on.

The count was tracked, whereupon the program iterates again through individual rows in the new table to display the results - if you sort it, it does this last bit again depending on how you want to sort it.

Athas
Aug 6, 2007

fuck that joker

Why are you working there? Why do you want to work with this thing?

Space Kablooey
May 6, 2009



:sever:

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



Athas posted:

Why are you working there? Why do you want to work with this thing?

They have great benefits, I hear there's even free coffee in the break room.

qntm
Jun 17, 2009

Athas posted:

Why are you working there? Why do you want to work with this thing?

Healthcare work is a public service for developers. One day you may end up a patient at the hospital which depends on that system.

Dragyn
Jan 23, 2007

Please Sam, don't use the word 'acumen' again.

I'm an analyst for a company that has implemented an HIE on Ensemble/Healthshare, I feel your pain. Our development environment is almost completely useless. (We have dev, uat, and prod)

You don't happen to work for managed services provider with a 2 character alpha-numeric name, do you?

Cuntpunch
Oct 3, 2003

A monkey in a long line of kings
code:
[TestMethod]
[ExpectedException(typeof(Exception))]
public void Method_ThrowException()
{
	var mock = new Mock<IFoo>();
	mock.Setup(s => s.Method()).Throws<Exception>();

	var target = new FooWrapper(mock);
	
	target.MethodWrapper();
}
:madmax:

How does one not lose their mind when trying to refactor a brownfield application that's been poorly architected for years? All I want is the ability to *actually* write a solid set of unit tests, since having only ~700 unit tests for a 75kloc application seems...concerning. And then I keep finding out the majority of the existing unit tests are like the above.

fritz
Jul 26, 2003

Cuntpunch posted:

All I want is the ability to *actually* write a solid set of unit tests, since having only ~700 unit tests for a 75kloc application seems...concerning.

I am basically the only person writing unit tests at this company, and all our products are greenfield. (Thankfully the guy who was ideologically opposed to unit tests has left). I've given up trying to change this and just write my tests in peace.

JawnV6
Jul 4, 2004

So hot ...

Subjunctive posted:

We had some unit tests as well, but I think that was roughly our ratio. We also made heavy use of internal dogfooding (about half our employees are running the daily build), which helps a lot.

E: actually, was more like 20:1 I think.
Imagine what the ratio would need to be if mistakes had consequences or something.

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

Cuntpunch posted:

And then I keep finding out the majority of the existing unit tests are like the above.
This test also illustrates one of the reasons I hate mocks, they allow you to write tests that look like they do a lot but in fact don't test anything. When refactoring a chunk of code I don't know if it's failing because you're special snowflake mock setup is now not valid anymore or if there's actual business logic that's broken.

Che Delilas
Nov 23, 2009
FREE TIBET WEED

Cuntpunch posted:

code:
[TestMethod]
[ExpectedException(typeof(Exception))]
public void Method_ThrowException()
{
	var mock = new Mock<IFoo>();
	mock.Setup(s => s.Method()).Throws<Exception>();

	var target = new FooWrapper(mock);
	
	target.MethodWrapper();
}
:madmax:

How does one not lose their mind when trying to refactor a brownfield application that's been poorly architected for years? All I want is the ability to *actually* write a solid set of unit tests, since having only ~700 unit tests for a 75kloc application seems...concerning. And then I keep finding out the majority of the existing unit tests are like the above.

Make it better one class at a time.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

JawnV6 posted:

Imagine what the ratio would need to be if mistakes had consequences or something.

I wouldn't rely on manual QA for safety-critical anything.

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


fritz posted:

(Thankfully the guy who was ideologically opposed to unit tests has left).

Awesome. What arguments did he offer for this? The most common one I've heard is some variation on "they slow me down :cool:"

Cuntpunch
Oct 3, 2003

A monkey in a long line of kings

Che Delilas posted:

Make it better one class at a time.



Architecture > Generate Code Map for Solution and Invoke Eldritch Incantation

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Athas posted:

Why are you working there? Why do you want to work with this thing?

Well, I dropped out of my CS major in college after I got in a fistfight with the department chair (he started it). I worked a number of poo poo IT monkey jobs after college until I heard about this place, which hired me as a technical writer for double what I was making at the time. They then paid for me to take a bunch of CS courses and a well-regarded university and then put me into a junior dev position, which is what I do now. The irony is that I didn't really understand what a mess things were until I started to take the CS courses they were paying for :). That other guy kids, but our benefits are really great too. My insurance has no copays, everything is covered (literally everything, our summary of benefits is the list of 5 things that aren't covered instead), and it's a flat rate no matter how many dependents I have. There's a bunch of the typical tech stuff (free unlimited juice and sparkling water and the like), but we also have 3 on-site cafeterias that are run by chefs who have one poo poo like james beard awards where I can get a 6-oz steak for like 5 bucks.

And my office is in a building that looks like a castle. On the other end of the 800 acre campus is a building that looks like a barn.

Long term? I need to stick around at least until I no longer need to pay back my tuition and my 401k is full vested. After that? I dunno. The processes are a mess, but the actual work is really fun, the environment is great, and developers get six figgie salaries in a location where a family of 5 can easily live on like 60k a year household. Like, maybe I'll decide I'm tired of winter, or broken svn workflows, or something, but on the other hand most of the other companies that could pay me what I make here (and aren't Google, Facebook, or MS, for which I don't have nearly the credentials needed to work at) are ridiculous unicorn tech bubble companies that won't exist in a year, whereas EMRs are on the sweetest of government handouts and will basically always exist, barring full communism.

Dragyn posted:

I'm an analyst for a company that has implemented an HIE on Ensemble/Healthshare, I feel your pain. Our development environment is almost completely useless. (We have dev, uat, and prod)

You don't happen to work for managed services provider with a 2 character alpha-numeric name, do you?

I work for an EMR vendor. Ironically, we're pretty widely considered to be the best one. KLAS scores are more like a battle of being the least bad, though, imo.

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

piratepilates posted:

They have great benefits, I hear there's even free coffee in the break room.

Oh, so you've been by my location, then.

Amberskin
Dec 22, 2013

We come in peace! Legit!
Yesterday I found an example of the mytical "dothingsright" property in the wild. And the default is "false".

That rare creature can be found in IBM's JDBC drivers for DB2. This is what happened: in my company we are starting to deploy JEE applications which use DB2 running on a mainframe as data store. The guys who manage the JEE servers found one of those applications was triggering something like 6-7 full garbage collections each minute (and it was not yet getting the final, expected hit rate!).

We spent half the day looking for a memory leak in the application. Until someone noticed the GCs were not due to exhausted memory, but to the driver spawning literally thousands of timer threads. To be specific, one timer thread for each SQL statement executed by the application.

Yikes!

So we begun to do some research about that and found that the timers were created by the driver when either the application sets up a queryTimeOut, or when the datasource has the property "commandTimeout" specified. By default, the driver fires a timer thread and if the timer expires before the server has answered the query, it cancels it (and the application gets a cancelled exception). I

Then someone found THIS:

http://www-01.ibm.com/support/docview.wss?uid=swg1PM15292

The relevant part is this:

quote:

All Connectivities: A new property "timerLevelForQueryTimeOut"
has been added. The possible values are:
DB2BaseDataSource.QUERYTIMEOUT_STATEMENT_LEVEL
JCC will create a queryTimeOut timer for each Statement.
At end of statement execute, JCC will dispose the Timer.
DB2BaseDataSource.QUERYTIMEOUT_CONNECTION_LEVEL
JCC will create a queryTimeOut timer for each Connection.
At time of Connection.close, JCC will dispose the Timer.
(138475)

So, yeah, that "timerLevelForQueryTimeout" could be named "doThingsRight". And the default is "FALSE".

:bang:

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.
:smith: Why isn't all of our data in 3NF?
:downs: Who cares about database normalization? We control the data, we can do whatever we want with it.
:smithicide:

ChickenWing
Jul 22, 2010

:v:

leper khan posted:

:smith: Why isn't all of our data in 3NF?
:downs: Who cares about database normalization? We control the data, we can do whatever we want with it.
:smithicide:

:negative:

Che Delilas
Nov 23, 2009
FREE TIBET WEED

leper khan posted:

:smith: Why isn't all of our data in 3NF?
:downs: Who cares about database normalization? We control the data, we can do whatever we want with it.
:smithicide:

Translation: "I don't know what 3NF is, but I can't admit to not knowing anything so I'll spout off something specious and hope you buy it."

Carbon dioxide
Oct 9, 2012

http://blog.danlew.net/2015/04/18/is-your-user-a-goat/

I don't know if this was posted here before but it's cool.

Related: Did you know there's a built-in Mathematica function for recognizing if an image has a goat in it? http://codegolf.stackexchange.com/questions/71631/upgoat-or-downgoat/71680#71680

Carbon dioxide fucked around with this message at 09:44 on Feb 13, 2016

TheresaJayne
Jul 1, 2011

Athas posted:

Why are you working there? Why do you want to work with this thing?

I am working on the SatNav Systems that will direct the Paramedics to you when you need help.

See - We all do the work we do because it can help someone,

feedmegin
Jul 30, 2008

TheresaJayne posted:

I am working on the SatNav Systems that will direct the Paramedics to you when you need help.


:ohdear::hf::stonk:
We're all gonna dieeee

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

leper khan posted:

:smith: Why isn't all of our data in 3NF?

Performance? Denormalization can be cool and good.

Amberskin
Dec 22, 2013

We come in peace! Legit!

Subjunctive posted:

Performance? Denormalization can be cool and good.

Yeah, but that's only when you know what normalization is, and why denormalization can do any good.

I have difficulties with some contractors trying to convince them to normalize to 1NF. The usual answer I get when I reject a database model (yeah, I review database models and other weird things) is "why 1NF?".

I open an entity description and see something like 20 attributes named AMMOUNT1, AMMOUNT2... AMMOUNT20. The usual conversation is:

Me: This is not 1NF.
The contractor: What is 1NF?
Me: That's database design 101. You can't put an array into an entity.
Him: It is not an array, just 20 fields with the same name.
Me: That. An array. You should not do that.
Him: Oh, the business spec says that field can have just 10 values. I've defines 20 just to be safe. It will never exceed that, legit!
Me: No. Normalize it.
Him: Oh, I've already written the code, and we have a deadline next week. You know, you must take the model as is and I promise you to fix it in the next iteration.
Me: No. gently caress it. Don't code before passing the design review.
His boss: Please approve it, we need to go into production yadda yadda yadda...
Me (to my boss): Look at those morons
My boss: Don't approve it. I'll stand by you.
His boss: (political moves out of my sight)
My boss: Oh, on second thought, accept it.

I won't tell you in what industry I am, but I'm sure some of you have already guessed it.

Edison was a dick
Apr 3, 2010

direct current :roboluv: only

Amberskin posted:

I won't tell you in what industry I am, but I'm sure some of you have already guessed it.

Any of them?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

I was going to go with "all of them"

Adbot
ADBOT LOVES YOU

fritz
Jul 26, 2003

Doc Hawkins posted:

Awesome. What arguments did he offer for this? The most common one I've heard is some variation on "they slow me down :cool:"

He refused to distinguish between "unit tests" and "test driven development" and emailed multiple manifestos to the whole company about how he wrote "intentionally bad code" and blamed me for everything.

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