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
-Anders
Feb 1, 2007

Denmark. Wait, what?

Carbon dioxide posted:

Does this thread have opinions on Selenium vs Cucumber testing? As far as I know, cucumber is mostly a layer that exists on top of selenium that makes the test cases that are being executed more human-readable but it's quite possible it adds a lot more functionality.

By the way, if there's one thing I learned about testing during my career so far, it's that while developers SHOULD be writing unit tests whenever possible, and especially for algorithmically complex code, it's also extremely valuable to have a dedicated test engineer in your development team, who takes care of and updates browser/UI tests, does manual testing of new functionality, and discusses options for automatic integration tests and the like with the rest of the team.

People, especially managers, consistently underestimate how many bugs you can remove pre-release by just having a full-time test engineer on board. Mostly because test engineers can look at it freshly, while developers such as myself tend to get so deep into the code site of things that they tend to lose track of some minor aspects of the functionality, so if they have to test their own stuff, they tend to miss those things.

Convince your management to hire a test engineer, if you can. It's fully worth it.

To build on this;
How does one go about becoming good at tests/becoming a test-engineer?
For some odd reason I'm really fascinated by automated tests but seeing as how I'm just starting out with programming, there's a long way to go before I'll be able to really specialise in anything I think.

For now I'm doing JavaScript stuff with node.js, and then I'll move on to some front-end frameworks after that, depending on what's hot in my area. I've been using Mocha/Chai for testing for now, but I've had my eyes set on trying out Jest as well.

Adbot
ADBOT LOVES YOU

Keetron
Sep 26, 2008

Check out my enormous testicles in my TFLC log!

Carbon dioxide posted:

Does this thread have opinions on Selenium vs Cucumber testing? As far as I know, cucumber is mostly a layer that exists on top of selenium that makes the test cases that are being executed more human-readable but it's quite possible it adds a lot more functionality.

Selenium is a lot of things, but it is not a framework to run your testable specifications in which is exactly what cucumber is.
I work as a software engineer in test, meaning I write the code that will execute the tests where the actual test specs are written by the testers. One of the many ways to do this is to use Cucumber to write down your features.

Selenium will allow you to use code to talk to your browser.

If you have any specific questions, I might be able to answer them. I work in Java, using Cucumber, RestAssured, Selenium and whatever else I need.

Keetron
Sep 26, 2008

Check out my enormous testicles in my TFLC log!

-Anders posted:

To build on this;
How does one go about becoming good at tests/becoming a test-engineer?

Do it a lot, try to think about the people who come after you to maintain your testcode and never underestimate the complexity some developers find maintainable.

The Leck
Feb 27, 2001

Portland Sucks posted:

Our main application is approaching 50k LOC with 0 tests. :allears:
That's like 5-6 (completely untested) classes in ours. We've finally started writing some tests, but so far, we're at about 2% code coverage of ~750k LOC. :smithicide:

Turambar
Feb 20, 2001

A Túrin Turambar turun ambartanen
Grimey Drawer
How are you using Selenium nowadays? I used the IDE last year to quickly make a test.

With the Firefox plugin changes, the IDE is now no longer available. Do you keep an old version around, or are there better ways? (Dotnet, preferably)

Turambar fucked around with this message at 18:35 on Jan 6, 2018

geeves
Sep 16, 2004

Portland Sucks posted:

Our main application is approaching 50k LOC with 0 tests. :allears:

We have 270k lines of Java with 5% coverage
We have 50k lines of JS with 2% coverage

:stare:


I'm the only one who writes unit tests :(

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Keetron posted:

Do it a lot, try to think about the people who come after you to maintain your testcode and never underestimate the complexity some developers find maintainable.

Yes. "I understand it just fine. You're the idiot."

Xarn
Jun 26, 2015
We have 85% and its good enough. We could chase after the last couple percent but

A) gcov is garbage and invents lines out of nowhere
B) I don't feel like testing that our structured exception handler runs properly (which means prints what killed us and exits)

Ither
Jan 30, 2010

-Anders posted:

To build on this;
How does one go about becoming good at tests/becoming a test-engineer?

First, you must find dark pleasure in breaking people's stuff.

The rest will follow.

KoRMaK
Jul 31, 2012



-Anders posted:

To build on this;
How does one go about becoming good at tests/becoming a test-engineer?

Get familiar and good with the tool, like as a proficient user, and then start finding seems where you can wedge it open.

Paolomania
Apr 26, 2006

-Anders posted:

To build on this;
How does one go about becoming good at tests/becoming a test-engineer?
For some odd reason I'm really fascinated by automated tests but seeing as how I'm just starting out with programming

There are fewer people who want to specialize in test, so just have some programming experience under your belt and familiarity with a unit test and integration test framework in your language of choice, then apply to lots of junior test eng positions.

Also have a mental model of how vetted code is:

1. Code's natural behavior is an unknown that is just everyone's best guess until it causes an issue (of unknown severity) in production.
2. Code's behavior may be known but undocumented. This is a crappy state and is vulnerable to reverting to 1 if the person who knows leaves.
3. Code behavior may be documented but un-handled. Think of a comment in the code that says "This is bad" or "This should never happen", or someone filed a bug, maybe with an assert if you are lucky (or unlucky depending on how you feel about task failure in production).
4. Code may be documented and handle various cases, but may be untested. Without tests we really aren't that far past 1) as the true behavior is just a best guess. Even with tests, any uncovered code counts as this.
5. Code may be tested to some minimal range of inputs (I.e. One run with common good and bad values). Your first goal should be to get over 80% of code in this state through both testing and redesign of components for testing.
6. Code may be tested with a range of valid and invalid inputs, including edge cases. This is a desirable state, but not a guarantee of perfect code, as requirements may be wrong or tests may express the wrong constraints, or tricky hackers might find ways to weasel buffer overflows through your code's error checks.
7. Code may be stress tested in a variety of ways: load tested, performance tested, fuzz tested, and history of these can be monitored over time to assess overall code quality and regression thereof. Pro test engineers worry about this kind of stuff.

Iverron
May 13, 2012

Whats the going recommendation on dealing with an rear end in a top hat? Particularly a fellow developer thats the socially inept, obsessive, my opinion must always be heard sort.

Ive tried the avoidance route, no dice.

Keetron
Sep 26, 2008

Check out my enormous testicles in my TFLC log!

Paolomania posted:

There are fewer people who want to specialize in test, so just have some programming experience under your belt and familiarity with a unit test and integration test framework in your language of choice, then apply to lots of junior test eng positions.

Also have a mental model of how vetted code is:

1. Code's natural behavior is an unknown that is just everyone's best guess until it causes an issue (of unknown severity) in production.
2. Code's behavior may be known but undocumented. This is a crappy state and is vulnerable to reverting to 1 if the person who knows leaves.
3. Code behavior may be documented but un-handled. Think of a comment in the code that says "This is bad" or "This should never happen", or someone filed a bug, maybe with an assert if you are lucky (or unlucky depending on how you feel about task failure in production).
4. Code may be documented and handle various cases, but may be untested. Without tests we really aren't that far past 1) as the true behavior is just a best guess. Even with tests, any uncovered code counts as this.
5. Code may be tested to some minimal range of inputs (I.e. One run with common good and bad values). Your first goal should be to get over 80% of code in this state through both testing and redesign of components for testing.
6. Code may be tested with a range of valid and invalid inputs, including edge cases. This is a desirable state, but not a guarantee of perfect code, as requirements may be wrong or tests may express the wrong constraints, or tricky hackers might find ways to weasel buffer overflows through your code's error checks.
7. Code may be stress tested in a variety of ways: load tested, performance tested, fuzz tested, and history of these can be monitored over time to assess overall code quality and regression thereof. Pro test engineers worry about this kind of stuff.

Yes, there is many levels of 7 that are well described in the testing pyramid that can be found all over the internet.
The essence is here: https://martinfowler.com/bliki/TestPyramid.html
A really nice article is here: http://james-willett.com/2016/09/the-evolution-of-the-testing-pyramid/

The tooling to look into as a test engineer rather depend on the ecosystem you wish to venture in. I can recommend the java sphere but that is also because I nothing little about other groups of languages/tools and because it is one of the bigger and will thus have more commercial possibilities.

In java, get proficient in or at least some knowledge of (it exists and you know where to find it)
- Java and IntelliJ
- JUnit
- Selenium for frontend testing
- RestAssured for API testing
- Cucumber JVM as business readable testing framework, comes with Gherkin
- XPath and jsonPath to analyse XML and json (and obviously XML and json so you know what you are looking at)
- There is some demand for FitNesse/HSAC in my locality which can be contributed to the developers who roam these here lands. This is purely java oriented.
- Git. If you want to be taken seriously by any developer, know how Git works. ( http://www.ohshitgit.com/ )

If you can do these, the missing pieces are often project specific, but these are the big overlapping pieces.

But here comes the good part, this list goes for other ecosystems as well, only the names change a bit and maybe others in this forum can help for JavaScript or Ruby or whatever? Let's assume JavaScript.

JavaScript testing stack:
- JavaScript and Webstorm
- [unit test framework]
- Selenium / protractor for front-end testing
- [API testing for JavaScript]
- Cucumber Js as business readable testing framework, comes with Gherkin
- XPath and jsonPath to analyse XML and json (and obviously XML and json so you know what you are looking at)
- Git. If you want to be taken seriously by any developer, know how Git works.

Messyass
Dec 23, 2003

Carbon dioxide posted:

Does this thread have opinions on Selenium vs Cucumber testing? As far as I know, cucumber is mostly a layer that exists on top of selenium that makes the test cases that are being executed more human-readable but it's quite possible it adds a lot more functionality.

This is a common misunderstanding. Selenium is specifically for use at the UI level, Cucumber can be used at any level of the testing pyramid, the lower the better.

If anything, it's a tool to make your unit tests more human-readable, but it's much more than that. I highly recommend reading up on BDD and Specification by Example (roughly the same idea) to see how it can be used.

Keetron
Sep 26, 2008

Check out my enormous testicles in my TFLC log!

Cucumber is nice as it allows me to show the business people what I am actually testing and then they can say if it covers what they think the feature should be doing. And then we expand the testing so it covers better what the feature should be doing.

-Anders
Feb 1, 2007

Denmark. Wait, what?






Thank you all for the great advice. I've got some more stuff to do/work with now, and that's great!
Today I'll rewrite my terrible twitterbot to a more functional style, and then write tests for everything of course. :3:

Volmarias
Dec 31, 2002

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

Iverron posted:

What’s the going recommendation on dealing with an rear end in a top hat? Particularly a fellow developer that’s the socially inept, obsessive, “my opinion must always be heard” sort.

I’ve tried the avoidance route, no dice.

If you don't have good people skills, find a respected manager with good people skills in their reporting chain and ask them to perform a come to jesus talk. There's not a lot else you can do.

Just see if you can impress on them the right attitude. I am thankful everytime my manager tells me that I have hosed up in a meeting and how (after the meeting) because it's a chance to never do that again.


This is magnificent.

Volmarias fucked around with this message at 15:02 on Jan 8, 2018

Keetron
Sep 26, 2008

Check out my enormous testicles in my TFLC log!

Volmarias posted:

I am thankful everytime my manager tells me that I have hosed up in a meeting and how (after the meeting) because it's a chance to never do that again.

Can you teach me how to do this, I need this in my life. My wife agrees and also thinks I need this in my life.

Volmarias
Dec 31, 2002

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

Keetron posted:

Can you teach me how to do this, I need this in my life. My wife agrees and also thinks I need this in my life.

Ask your manager to tell you when you've hosed up, assuming that they don't already know to tell you from your lack of social graces.

Munkeymon
Aug 14, 2003

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



Rocko Bonaparte posted:

4. If something goes uncharacteristically wrong, then return 11. I personally still don't get this. I guess because it's two one's instead of just one.

Spinal Tap reference?

Keetron
Sep 26, 2008

Check out my enormous testicles in my TFLC log!

Volmarias posted:

Ask your manager to tell you when you've hosed up, assuming that they don't already know to tell you from your lack of social graces.

Oh, I get the feedback alright. I was hoping for insight into the acceptance.

Volmarias
Dec 31, 2002

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

Keetron posted:

Oh, I get the feedback alright. I was hoping for insight into the acceptance.

I don't know what your interpersonal relationship is like, but I accept it from a place of constructive criticism from someone with social graces and political acumen who wants me to improve. Make sure it's actionable feedback, not "don't be such a fuckup next time, cripes"

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Munkeymon posted:

Spinal Tap reference?

Knowing the originator, it would be remotely possible, but still really arbitrary.

Pollyanna
Mar 5, 2005

Milk's on them.


e: nah gently caress it

Pollyanna fucked around with this message at 18:52 on Jan 9, 2018

Portland Sucks
Dec 21, 2004
༼ つ ◕_◕ ༽つ

Rocko Bonaparte posted:

That is kind of severe though but the ones that stick with it need forced re-education.

I can think of a few more:
1. "Python's great because I can get a few lines of code working at one time, paste them into a file, and then just run the whole file later to reproduce what I did."
2. A script is "robust" if it runs more than once.
3. Don't even bother looking for 3rd-party libraries that might help online. They simply don't exist. Nobody has ever done what you are doing before because your work is elite.
4. If something goes uncharacteristically wrong, then return 11. I personally still don't get this. I guess because it's two one's instead of just one.
5. If an exception is raised when using somebody else's code, it's clearly their fault because I'm not working with exceptions.
6. In dynamically-typed languages, it's great that I can assign different data types to the same variable as it meanders through 10,000 lines of code. It keeps me from having to declare new variables, which is inefficient.

I'm starting to think we work for the same people. I've had a conversation with my peers about every single one of these.

They've been using Python since 23, do a ton of statistics, excel processing, etc... and have never heard of numpy in TYOL 2018 let alone pandas.

Today I ran across a wild "return -60". "Why -60?" I asked. "It just needed to be less than 0 and I figured this would be less confusing than -1 for the next person who came along."

I think he meant that the number -60 being smaller than -1 would make it more obvious that it was a failure than just old regular -1.

I'm pretty sure they think programming is actually just black magic voodoo.

redleader
Aug 18, 2005

Engage according to operational parameters

Portland Sucks posted:

I'm pretty sure they think programming is actually just black magic voodoo.

And you don't?

Sedro
Dec 31, 2008

Portland Sucks posted:

Today I ran across a wild "return -60". "Why -60?" I asked. "It just needed to be less than 0 and I figured this would be less confusing than -1 for the next person who came along."

I think he meant that the number -60 being smaller than -1 would make it more obvious that it was a failure than just old regular -1.

I thought exit codes are in the range [0,255]?

geeves
Sep 16, 2004

Keetron posted:

Can you teach me how to do this, I need this in my life. My wife agrees and also thinks I need this in my life.

I think more valuable would be sharing how you hosed up.

geeves
Sep 16, 2004

Portland Sucks posted:

I'm pretty sure they think programming is actually just black magic voodoo.


Dude, I had a bug today that magically pointed an integer interpreted in JSP as a String which as a column (on the same row in the table) as some sort or strange pointer - this worked for 6 years until Struts 2.5.

geeves fucked around with this message at 03:23 on Jan 10, 2018

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

Portland Sucks posted:

I'm starting to think we work for the same people. I've had a conversation with my peers about every single one of these.
The worst part is that we probably don't work for the same people. That means this hideous hell is at least twice as large as we want it to be.

geeves posted:

pointed an integer interpreted in JSP as a String which as a column (on the same row in the table) as some sort or strange pointer
Girls who are boys
Who like boys to be girls
Who do boys like they're girls
Who do girls like they're boys
Always should be someone you really love

Keetron
Sep 26, 2008

Check out my enormous testicles in my TFLC log!

Portland Sucks posted:

I'm pretty sure they think programming is actually just black magic voodoo.

If I pass a jayway.restassured response to a method and there parse the body as String, the assert fails.
If I parse the body to String before passing it to the same method, who is changed to accept a String, the assert succeeds.
The assert is a jsonPath matching an expected value in the json where the jsonPath is the same one but the jsonPath complains that it is a java.String instead of a JsonArray.

Maybe it is a bug but I made it work in the end.

BabyFur Denny
Mar 18, 2003

Keetron posted:

If I pass a jayway.restassured response to a method and there parse the body as String, the assert fails.
If I parse the body to String before passing it to the same method, who is changed to accept a String, the assert succeeds.
The assert is a jsonPath matching an expected value in the json where the jsonPath is the same one but the jsonPath complains that it is a java.String instead of a JsonArray.

Maybe it is a bug but I made it work in the end.

time to post my favourite json image:

FlapYoJacks
Feb 12, 2009
Lmbo. The other engineer just put in his 2 weeks because the company was paying him 20k less than he is worth (citing not enough money to pay him 85k ), then magically found 85k for a 3rd dev.

Management had the balls to ask me to cover his work as well. The tone deafness from baby boomers never ceases to astound me. :allears:

Pollyanna
Mar 5, 2005

Milk's on them.


Why cant you just be happy with the money you get???? Selfish money grubbing millennials. *takes nap on giant wealth and stock funded Scrooge McDuck bed of money*

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

ratbert90 posted:

Lmbo. The other engineer just put in his 2 weeks because the company was paying him 20k less than he is worth (citing not enough money to pay him 85k ), then magically found 85k for a 3rd dev.

Management had the balls to ask me to cover his work as well. The tone deafness from baby boomers never ceases to astound me. :allears:

It is pretty amazing how we can reliably reason ourselves into the worst possible solution for ourselves. So now they get to pay 85k for someone they get to train, who in all likelihood will suck. All to avoid admitting to not properly valuing the thing they had in the first place.

Keetron
Sep 26, 2008

Check out my enormous testicles in my TFLC log!

Look, we can give you a raise but then we would have to give everyone else a raise as well and we just do not have the capital for that. We would be sad to see you go but if you have to go, you have to go.

FlapYoJacks
Feb 12, 2009

Keetron posted:

Look, we can give you a raise but then we would have to give everyone else a raise as well and we just do not have the capital for that. We would be sad to see you go but if you have to go, you have to go.

This was the argument they used almost verbatim.

They also got REALLY mad when I said "engineering is worth more than manufacturing."

*Edit*

I told them I talked to my friend who is the CTO and co-owner of TSheets over the matter, who built the company from scratch and is selling to Intuit for $324,000,000. They literally said him taking on debt at the beginning to pay for engineering was a bad business decision.

HE'S WORTH 300 TIMES WHAT OUR COMPANY IS WORTH.

Baby boomer stupidity knows no bounds.

FlapYoJacks fucked around with this message at 20:58 on Jan 10, 2018

Taffer
Oct 15, 2010


ratbert90 posted:

Lmbo. The other engineer just put in his 2 weeks because the company was paying him 20k less than he is worth (citing not enough money to pay him 85k ), then magically found 85k for a 3rd dev.

Management had the balls to ask me to cover his work as well. The tone deafness from baby boomers never ceases to astound me. :allears:

Put in your notice immediately. That mistreatment is about to get a lot worse.

FlapYoJacks
Feb 12, 2009

Taffer posted:

Put in your notice immediately. That mistreatment is about to get a lot worse.

I've been applying for jobs for the last week. As soon as I have an offer I will bounce.

Adbot
ADBOT LOVES YOU

Volmarias
Dec 31, 2002

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

ratbert90 posted:

my friend who is the CTO and co-owner of TSheets

I think I found your new employer

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