We are in a very funny situation where I just spent two weeks fixing FE bugs and there are so many left. I asked to add integration tests but the answer was “no”, cause we can’t test the UI and all of that.

So the proposed solution was to be more careful, except I’m careful but testing whole website parts or the whole website is not feasible. What can I do?

26 points

You need to create a list of incidents that reached customers. Create a matrix that has the incident ID, the link to the incident documentation and the type of test that would have caught the incident.

Then they’ll see that their incidents would have been caught by the tests you want to. push instead of an angry customer.

permalink
report
reply

They know. We have had a production website being literally unusable, sucking up a lot of resources for a bug.

We have a client which is MAD cause the project is riddled with bugs, but the solution somehow is paying more attention. Except that it clearly isn’t feasible to pay more attention when you have to check, recheck and check again the same thing over and over… They say it’s a waste cause you can’t catch UI, and you will spend the same amount of time NOT writing tests; obviously this is all crap, but they somehow think they are smarter than google or any other small or big company that do write test

permalink
report
parent
reply
13 points
*

We have a client which is MAD cause the project is riddled with bugs, but the solution somehow is paying more attention. Except that it clearly isn’t feasible to pay more attention when you have to check, recheck and check again the same thing over and over…

By definition, automated testing means paying more attention, and doing it so well that the process is automated.

They say it’s a waste cause you can’t catch UI (…)

Show them a working test that’s catching UI bugs. It’s hard to argue against facts.

but they somehow think they are smarter than google or any other small or big company that do write test

Don’t sell a solution because others are doing it. Sell a solution because it’s a solution to the problem they are experiencing, and it’s in their best interests to solve it. Appeals to authority don’t work on everyone.

permalink
report
parent
reply
6 points

Show them a working test that’s catching UI bugs. It’s hard to argue against facts.

Ooooh you wouldn’t believe how easy it is for some people to argue against facts.

permalink
report
parent
reply
8 points

Who’s saying this? Other programmers or management?

Programmers might listen to reason, but might be very set in their ways. Some that don’t want it might even sabotage it and write crap tests that don’t do shit like test that true == true or skip all of them. Know your crowd. If it’s a crowd that like copying the latest and greatest, quote something google or facebook did or said. If they’re old-school, find some old-ass programmer that loves tests.

Management listen to money unless they’re incompetent. Calculate the time it took to resolve certain bugs, estimate the hourly-rate of people, compare that to how much time it takes to write tests, but make it clear that not all bugs can be caught. Maybe even find an article or blog from some manager/CTO/technical lead at another company talking about how bug count dropped or something.

If it’s a free for all, add tests yourself.

If they’re overbearing, bro, look for another job. A bad culture fit is a bad culture fit and there’s no need to fight that. It’ll be a learning experience too: not everybody can be convinced and not every company is for you.

permalink
report
parent
reply
6 points

Maybe a response to their ‘solution’ would be to ask them if they were under the impression you weren’t being careful/paying attention before the bugs occurred?

permalink
report
parent
reply
24 points
*

Show them the Beyonce Rule part of the Google SWE book.

We are often asked, when coaching new hires, which behaviors or properties actually need to be tested? The straightforward answer is: test everything that you don’t want to break. In other words, if you want to be confident that a system exhibits a particular behavior, the only way to be sure it will is to write an automated test for it. This includes all of the usual suspects like testing performance, behavioral correctness, accessibility, and security. It also includes less obvious properties like testing how a system handles failure.

We have a name for this general philosophy: we call it the Beyoncé Rule. Succinctly, it can be stated as follows: “If you liked it, then you shoulda put a test on it.” The Beyoncé Rule is often invoked by infrastructure teams that are responsible for making changes across the entire codebase. If unrelated infrastructure changes pass all of your tests but still break your team’s product, you are on the hook for fixing it and adding the additional tests.

permalink
report
reply
22 points

What does “FE” stand for in this context? Sorry if it’s obvious, I just don’t see anywhere that it’s actually written out.

permalink
report
reply

frontend

permalink
report
parent
reply
16 points

It’s very hard to start writing tests for a codebase that was not tested while it was being written.

“Be more careful” is obviously just wishful thinking, but the pain apparently hasn’t become bad enough for the need to better quality to have become apparent to everyone.

When people say “we can’t test the UI”, there’s often a reason that they are reluctant. One reason can be that they think you want to test through the UI, and write slow and cumbersome end-to-end tests. Those tend to become unmaintainable at record speeds, and if you’ve experienced the amount of work and aggravation that can cause, you tend to become reluctant. When you ask for ‘integration tests’, this might be the thing people are hearing.

That being said, there’s plenty of ways to test UI code locally, at the unit and component level. Depending on your tech stack, of course. Those types of tests you can just start creating without a big investment. In a codebase that’s not tested, that can be difficult, but try and make the changes you need to make to isolate logic, so it can be tested as a unit test. It’ll give you better code, and teach you a lot about structuring code so that you separate responsibilties.

permalink
report
reply
11 points

Just do it, whenever you fix a bug, add a test case for it, the cost is not going to be noticeable. You may choose to not upload the test suite right away, but wait until someone notices and asks you about it.

permalink
report
reply

Programming

!programming@programming.dev

Create post

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



Community stats

  • 3.6K

    Monthly active users

  • 1.8K

    Posts

  • 29K

    Comments