Verifying the behavior of a software system against the expected behavior of that system.

learn more… | top users | synonyms

0
votes
2answers
3k views

Should I use a separate class per test?

Taking the following simple method, how would you suggest I write a unit test for it (I am using MSTest however concepts are similar in other tools). public void MyMethod(MyObject myObj, bool ...
1
vote
1answer
45 views

Can composition be used in unit/integration testing over inheritance

In larger projects, there can often be a group of tests that test the functionality of related classes. These tests often share a lot of setup and preparation functionality. What happens then is ...
-2
votes
0answers
36 views

TDD with Django where to start [closed]

I'd like to try TDD on django but I don't know where to start. I've attended some coding-dojos where we where doing TDD and I really liked the idea. Now I'd like to try it out in real project but I ...
0
votes
4answers
716 views

What is the difference of smoke testing and black-box testing?

Main theme of my question is about the differences of Smoke Testing and other types of software testing specially Black-box testing but also I'm very curoius to know what is the purpose of this naming?...
4
votes
3answers
137 views

How would one test a function with a large number of scenarios?

I've heard that it's ideal to have one assert (or expect or should, etc) per aspect of a component's behavior you're trying to test. Is this how it works? An addOne function would be tested like this, ...
1
vote
1answer
27 views

How perform automated tests over code that changes a DBMS (throught DML or DDL)?

I'm written a software as an exercise to improve my skills and I ask my self about how to test code that changes a database. Let the code in my github: https://github.com/daniloanp/Ensaios/blob/...
0
votes
0answers
53 views

Do CI servers allow Maven to generate content outside target directory?

I'm maintaining a multi-module Maven project, I have a module that contains some tests, the tests run smoothly locally, but on the integration server they don't, and the logs shows only FileNotFound ...
3
votes
2answers
98 views

Diferences between Test vs Spec

I am having a concept problem at this point & I can't find any info about the differences between Test (UnitTest, etc) vs Spec (Rspec, etc). As far as I know, specs is into Integration tests and ...
1
vote
1answer
39 views

Abstracting end-to-end test cases across multiple pages

I am using Protractor and Jasmine to create end-to-end tests for a webpage. To test this initial page, I have abstracted made some common utility functions to create about 20 test cases for this ...
4
votes
1answer
70 views

Use Coded UI Tests for Integration

I have a couple of users who have a User Interface for an application that they must use to do their job. The UI can be cumbersome to navigate to perform some time critical tasks. This UI does not ...
67
votes
10answers
6k views

Where is the line between unit testing application logic and distrusting language constructs?

Consider a function like this: function savePeople(dataStore, people) { people.forEach(person => dataStore.savePerson(person)); } It might be used like this: myDataStore = new Store('some ...
67
votes
17answers
6k views

Is it reasonable to insist on reproducing every defect before diagnosing and fixing it?

I work for a software product company. We have large enterprise customers who implement our product and we provide support to them. For example, if there is a defect, we provide patches, etc. In other ...
1
vote
2answers
65 views

Parallel testing API based mobile application

The setup So we have a RESTful JSON API. There are iOS and Android applications that consume the said API (one of each). The code for the applications is such that the endpoints are hardcoded to "...
5
votes
3answers
371 views

How important is automated testing in rapid release, non-critical (web) apps?

I think I understand the theoretical benefits of automated testing, especially unit testing. However, I'm not sure what the optimal amount of testing is when the project is a non-critical, rapidly ...
11
votes
6answers
2k views

We are spending more time implementing functional test than implementing the system itself, is this normal?

Basically, we have three main projects, two of them are web services, and the other is a web application. While I'm satisfied with covering as much as we can of our web services with functional tests (...
0
votes
0answers
64 views

Should Rails views actually render anything?

I've joined a Rails app with hundreds of pages and no tests, first thing I've done is set us up with model-, controller- and feature-tests and I'm adding them as I work on areas. One thing I'm ...
72
votes
10answers
8k views

Are (database) integration tests bad?

Some people maintain that integration tests are all kinds of bad and wrong - everything must be unit-tested, which means you have to mock dependencies; an option which, for various reasons, I'm not ...
15
votes
7answers
583 views

How do you scale your integration testing?

I am investigating techniques and strategies for scaling our growing number of integration tests on our current product, so that they can (humanly) remain part of our development, and CI process. At ...
0
votes
2answers
140 views

How to get developers to fix broken tests

In our company we have multiple test stages: unit and integration tests (CI build) application tests (all calls to other systems are mocked) system tests (interacting with other systems) all ...
7
votes
3answers
3k views

Event Driven Programming: A sequence of unfortunate events

I have a very basic game loop whose primary purpose is to check for updates & changes to a list. I have contemplated using event driven programming to replace the game loop/list idea with an ...
1
vote
2answers
37 views

Update semver minor version on test updates?

I always try to adhere the semver spec when I commit changes. This time though I was wondering what to do when I update my tests: I'm working on an API client that includes a simplified API server ...
0
votes
0answers
32 views

Debugger directions

I am running an old DOS executable file that runs a set of instructions to test an electronic component via com1 (RS-232) on a pc. The 16bit software has 8 main routines and some subroutines within to ...
0
votes
0answers
36 views

Testing a factory service, am I doing it right?

I'm trying to integrate Pagerfanta in my Symfony application, so instead of creating the paginator objects in the controllers, I created an factory for instantiating the Pagerfanta objects: <?php ...
26
votes
3answers
3k views

Are integration tests meant to repeat all unit tests?

Let's say I have a function (written in Ruby, but should be understandable by everyone): def am_I_old_enough?(name = 'filip') person = Person::API.new(name) if person.male? return person....
7
votes
3answers
266 views

How to combine strict TDD and DDD?

TDD is about designing code, guided by tests. Thus, typical layers aren't usually built upfront; they should slightly appear through refactoring steps. Domain-driven design involves a lot of ...
1
vote
1answer
602 views

How do we structure our JavaScript so that it is easily editable, testable, and can make calls to render a view without knowing specifics about it?

I am working on a web application that displays some data and uses JavaScript. Right now, we are serving up parts of our JavaScript code (to display certain types of information, that is, "Render a ...
9
votes
5answers
2k views

When writing specs BDD-style, should you use “should”, or should you not? [closed]

I realize this is somewhat subjective, but I can't find a good case for one or the other : it "should do something" it "does something" Proponents of the should style mention that it forces ...
4
votes
2answers
34 views

Test arrangement using the system under test

I have some integration tests around stored procs. Typically I do the test setup using Dapper. This is fine for simple cases, but in some cases to setup up the system correctly it would be far simpler ...
1
vote
3answers
61 views

Automation testing strategy with changing test cases

Say, for example, you have a program that sends a message to a server and that server validates it. Note: The server validation process can have additional test cases due to it being implemented in ...
13
votes
2answers
1k views

How to go about testing un-injectable code?

So I have the following piece of code in use all over my system. We're currently writing unit tests retrospectively (better late than never was my argument), but I don't see how this would be testable?...
3
votes
4answers
172 views

Property based testing without reimplementing the code under test

Given a very simple method such as: def squaredDistance(p1: Point, p2: Point) = math.pow(p1.lon - p2.lon, 2.0) + math.pow(p1.lat - p2.lat, 2.0) What are some valuable property-based tests ...
24
votes
8answers
4k views

Wouldn't it be beneficial to write tests during code review?

A colleague of mine came up with an idea that I found interesting. Wouldn't it be beneficial to write tests during code review, by the person doing the review assuming that we don't do TDD? For ...
0
votes
1answer
63 views

What are unit tests called when they change data instead of relying on mocks or stubs?

What would you call a test that is similar to a unit test, except it actually modifies a file, directory, or database data? It is similar to a unit test in that it does test a single method of a ...
8
votes
4answers
366 views

Testing minor browser version compatibility

I develop a web application and we test it on several browsers, including Firefox and Internet Explorer. During our development we tested the application on Firefox 3.5.2 and our testing team tested ...
33
votes
6answers
3k views

Should there be unit tests for complex regular expressions?

Should I write unit tests for complex regular expressions in my application? On the one hand: they are easy to test because input and output format is often simple and well-defined, and they can ...
20
votes
12answers
4k views

How To Know When To Stop Testing?

I know this is a very very basic question. For some software applications there are a large almost infinitely high number of test cases for an application. It is not practical to test all those test ...
44
votes
7answers
3k views

Does software testing methodology rely on flawed data?

It’s a well-known fact in software engineering that the cost of fixing a bug increases exponentially the later in development that bug is discovered. This is supported by data published in Code ...
79
votes
12answers
7k views

Is there a reason that tests aren't written inline with the code that they test?

I've been reading a bit about Literate Programming recently, and it got me thinking... Well-written tests, especially BDD-style specs can do a better job at explaining what code does than prose does, ...
-1
votes
5answers
507 views

How to ascertain from the users if performance tuning has had the desired effect [closed]

So you've made some code changes that should hopefully speed up some part of an application. But there is just one problem - you don't know how it will perform in live. Different networks, different ...
10
votes
5answers
3k views

Test Driven Development: A good/accepted way to test file system operations?

I am working on a project at the moment that generates a table (among other things) based on the contents of a file-system, and in turn does some meta-data modifications on the things it finds. The ...
0
votes
1answer
59 views

UI Testing and Code Coverage [closed]

My company wants me to write UI tests that test the business logic (all of the use cases MUST be independently testable) I decided to do it in selenium. I have managed to create a decent product (as ...
1
vote
0answers
48 views

Determining if webgl code will work on a variety of hardware

I have some javascript/webgl code. I want to have some idea of whether it will work for someone with a different browser/machine/gpu. This is difficult, because there's so much diversity in support ...
8
votes
2answers
593 views

Unit Testing a stateful framework such as Phaser?

TL;DR I need help in identifying techniques to simplify automated unit testing when working within a stateful framework. Background: I'm currently writing a game in TypeScript and the Phaser ...
2
votes
1answer
60 views

Writing Automated test cases for a folder Archiving Class.

Using C# and Visual Studio, I've developed a class that zips and archives a folder into desired location, creating directories and manipulating files on a machine. The intended use is as an part of ...
32
votes
9answers
5k views

How can QA staff test caching logic that they can't see?

I just implemented a caching layer in my web application, and now I'm wondering how QA is supposed to test it, since caching is transparent to the user. One idea I have is to put logging in the ...
-2
votes
1answer
116 views

Test Cases in an Interview Setting

In the first cracking the coding interview video Ms. McDowell talks about candidates that begin by writing test cases in whiteboard interviews. How would one go about this? For example, the ...
5
votes
3answers
188 views

Should unit tests always overlap

This is a test design question. I have a class 'handler' that accepts a 'validator' that checks some business logic on what's passed to the handler. I made the unit tests for the validator and now I'...
1
vote
1answer
73 views

Testing a bootloader written from scratch?

I'm planning to write a simple bootloader. Nothing too complicated. Just really basic output and maybe keyboard input. But it seems a bit crazy to restart my computer every time I want to run the ...
1
vote
2answers
75 views

How short/stable should tests/build be for working CI/CD pipeline?

(Please note that this question is linked to this: How can Continuous Delivery work in practice? - but it asks a more specific question regarding time and stability). CI/CD, no manual QA, super quick ...
1
vote
1answer
172 views

Should I have code that only exists for testing?

I have a service class which is responsible for instantiating repositories and using them. It makes an external Http request which ideally I would like to mock for testing. However, I am not quite ...