Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

1
vote
1answer
65 views

A performant and robust way to reset multiple files to its original state (TDD)

In our automated Java tests, we sometimes encounter issues, such as: Test A creates a custom file A.sh, that is then added on classpath Automated testsuite cleanup does not know about random file A....
2
votes
3answers
208 views

How far should I go with dependency injection and mocking?

Say I have a following class: public class A { public void execute() { if (something) ThirdPartyApi.method(); } } Now, I would like to test in particular the execute() method. I ...
0
votes
2answers
206 views

How can I test generated assembly?

I'm working on a C compiler for Linux for the purpose of personal curiosity/fun. How can I test the generated assembly before the compiler is complete enough to do anything useful? For example, if I ...
-1
votes
1answer
58 views

Check files after git push, or; best practices for github after push tests

Sometimes our developers push -simple to find- mistakes to our repos, like a missing ";" a "console.log" that is not suppose to be in the main branch, or an invalid json file. With Github you can add ...
-3
votes
0answers
31 views

Testing a Rest controller with a in-memory database: Integration or System test?

While reading about types of tests, I couldn't answer the following question: If I write a test that performs a call to an REST endpoint without mocking anything on the way and use an in-memory ...
1
vote
3answers
155 views

Automated test “all changes are feature-flagged”, possible?

Let's say in an effort to improve quality, your team agrees on the following policy: all commits to the master branch (direct or via pull request) have to be categorized as either bugfixes or ...
-3
votes
1answer
88 views

test class that include another class - Only one test or both

i have a sytem a that include system b and return the result. simple!. concrete example an API, one controller that internally call another class then perform the operation. route --> controller ...
0
votes
1answer
79 views

How to Automatically Tell What is Not Tested [duplicate]

I feel like I've heard the phrase "Automated Test Coverage" but not really sure what it means. I am wondering if there is a way to do some sort of program analysis that will tell you which parts of ...
1
vote
0answers
27 views

Integrating Testing with Model Checking

So with Model Checking you have a specification and the model checker automatically goes through your program's states and checks if it matches the specification. What I don't understand is where ...
-1
votes
3answers
169 views

Should one be able to access a db during tests?

I had a conversation with a colleague about tests. They want to be able to access a db that is only accessed by tests. The db is created in memory and deleted after tests are done. My colleague wants ...
67
votes
16answers
14k views

How to avoid logical mistakes in code, when TDD didn't help?

I was recently writing a small piece of code which would indicate in a human-friendly way how old an event is. For instance, it could indicate that the event happened “Three weeks ago” or “A month ago”...
7
votes
3answers
439 views

What's the practical development cycle of a large project when a full build is prohibitively long

Projects like webkit, Linux kernel and many others take over ten minutes if not hours for a full build. What's the practical development cycle for these large projects? Specifically, how does a ...
0
votes
1answer
44 views

How to load test Publisher/Subscribing queue?

I am trying to load test a queue that works on a pub sub pattern and can't figure out how response time is to be calculate and the TPS(transactions per second). Problem statement : The pub sub ...
3
votes
5answers
520 views

If 100% test coverage is possible

In thinking about formal verification techniques, you also need to have test coverage. But as that article shows, you can easily say you have "100% test coverage", but every test doesn't have any ...
2
votes
0answers
47 views

Designing a test system on server/message level for large legacy application

I am working on introducing tests to an old system. Because of the amound of technical debt, we have landed on component/interface testing. The system is a servies of servers which sends messages in ...
2
votes
2answers
166 views

Is conditional dependency injection based on environment a bad pattern?

Is it a bad design if we inject dependencies based on the running environment (production, testing, development, etc)? Consider the following container in Laravel as an example: $app->singleton( ...
0
votes
1answer
96 views

How to test controllers in a REST applications

I'm writing a REST api backend in NODE js, which is based on MVC approach. My api routes directly hit the controllers, which in turn import models which are a wrapper around the methods from a library ...
2
votes
3answers
217 views

Should I test the debug branch of my code in a unit test?

Lets say I have a function that gets a list of what files to send that are later send over a socket to some other pc. Now usually I keep track of what files have been sent and don't send these files ...
1
vote
2answers
146 views

How do you unit test a microservice that makes a call to another microservice?

I have a suite of microservices: ConnectorRegistrar ConnectorTypeA ConnectorTypeB ... ConnectorTypeZ "Someone" can make a call to the ConnectorTypeA microservice to create a connector of type A, and ...
0
votes
0answers
42 views

what is the meaning of infection in mutation testing?

I got the following code: in the textbook that I am reading it says that for an infection to occur, mutation delta 1, it should be that the value of A must be different from the value of B. At this ...
0
votes
2answers
109 views

Testing an underwriting engine

I made a post in relation to this question on the SQA here but thought I would post on this board as it's more active. I'm testing an underwriting engine with a front-end interface that asks a ...
1
vote
1answer
44 views

Keeping Stubs in Sync?

If I want to test frontend code (e.g. react SPA) that queries the backend and I stub out the responses from the backend using sinon fake server/fake XHR, then what happens if the backend code changes? ...
0
votes
3answers
138 views

Unit Testing method with multiple steps

I have a validation method like this def validate(a, b, c, d, e, f): Boolean = { val rs1 = check1(a, b) val rs2 = check2(c, d) val rs3 = check3(e, f) rs1 && rs2 && rs3 } I ...
0
votes
4answers
216 views

Is there a “DevTest” or “DevQA” equivalent to “DevOps”?

I understand "devops" to be the application of the development processes (issue tracking, version control, release management...) to operations tasks (deployment, migration...). Is there an ...
0
votes
0answers
52 views

How to define equivalence classes for an input domain?

Lets say a persons commission is computed from the following: 10% on sales <= 100 dollars 20% on the next 100 dollars 30% on any sales > 200 dollars We have an input of three ...
6
votes
2answers
197 views

Is there a viable approach to testing for a negative in a safety critical codebase?

Given a requirement like if A and B and not C then D must happen within 10ms That can clearly be tested albeit at the cost of some pain proving the 10ms bit, but what happens if the requirement was ...
-2
votes
1answer
70 views

What is meant by “every branch” in testing coverage criteria?

I have generated the program graph of a method that contains an if condition and a for loop, and I need to generate test cases that covers "every branch". Would this include the for loop, given that ...
0
votes
1answer
62 views

Client-Side TDD Tests?

More specifically, with regards to ATDD (sort of BDD flavored, or some could argue what was actually intended in the first place by TDD) should be there much UI testing? As I have been testing my UI ...
8
votes
2answers
329 views

Philosophy on unit testing daisy-chained methods?

Problem Statement: I have a class that does some validation and it looks something like this: func a() {b()} func b() {c()} func c() {d()} func d() {e()} func e() {return} This is a simplified view,...
1
vote
1answer
82 views

Testing Client-Side Code w/o Introducing Brittleness

I'm finding it tough to test my client-side code without testing implementation details. For example, lets say you are testing a login form that displays client-side validation errors and does not ...
-2
votes
1answer
36 views

Is Python Doctest a White-Box or Black-Box technique

I have read many articles explaining the overview of black- and white-box testing, including this Stack Overflow question: https://stackoverflow.com/questions/7258524/unit-testing-black-box-testing-...
3
votes
2answers
67 views

White Box Testing vs Trace Tables

I've seen trace tables listed under white-box testing in one part of my syllabus, and separately under dry-run testing in another part. Could anyone please clarify whether trace tables are generally ...
2
votes
1answer
43 views

Functional tests for SVN management script

I have a Python script which is responsible for updating SVN repository (in a nutshell) and checking it. Now I'd like to write some functional tests for the script. To check whether SVN update has ...
0
votes
0answers
44 views

What are some good approaches for running end-to-end test with complex data?

Consider we have a system that is made out of 3 modules. ModuleA is dependent on some data which it's responsible for creating ModuleB is dependent on data which is created in ModuleA ModuleC is ...
-1
votes
2answers
251 views

Does reading over code I've written make sense to verify it?

After writing some code, I have a habit of scanning it all over once or twice in order to look for any bugs. This is sometimes a painstaking and tedious process, and it takes up time. After reviewing ...
-1
votes
1answer
61 views

How to Gain full Confidence in Pull Request builds

Having confidence means Pull Request builds (in Jenkins) will finally allow you to merge the code after a Pull request builds successfully and is reviewed. You're 100% confident that it can go into ...
1
vote
2answers
58 views

Selecting test cases to run by checking what's changed

Problem: If running all test cases takes too long, I manually specify a subset of tests to run while developing. But when I finally push to CI, it can happen that I broke some other tests or a ...
3
votes
2answers
54 views

Parameters to Service-level classes: Primitives or domain-specific types?

We have an existing web service which is currently modeled as a single project, where the web/service/manager/model classes have gotten a bit confused and intermingled. As a refactoring, we're pulling ...
0
votes
1answer
29 views

Testing Application Helper that Depends on Controller

I am working on practicing TDD/BDD/ATDD and I am working on a rails application. I created a helper method that depends conditionally on the type of controller being tested. module ApplicationHelper ...
1
vote
1answer
28 views

Worth it to test client side element presence for web application?

I've really been focusing on making my tests maintainable by focusing on BDD-style tests and only focusing on interfaces. I do not want my tests to be brittle and prevent refactoring. Is it worth it ...
1
vote
1answer
60 views

Fixtures, Tests, and Preconditions

When using factories, although more work is required up front, you know that you will be setting the correct pre-conditions for your test (up to what you have written.) However, when you use fixtures, ...
1
vote
2answers
118 views

When unit testing is not enough (what error cannot be found besides GUI)? [closed]

I am thinking, if I do proper testing for all methods in all my classes, then - disrgegarding UI - do I still need system testing? I mean, what would a simple example be, showing a case where unit ...
1
vote
2answers
89 views

Testing and Debugging Techniques vs. Rice's Theorem

As far as I got it correctly, as a result of Rice's theorem, the equivalence of two programs is generally not decidable. Nevertheless, there exists a wide variety of testing and debugging techniques, ...
0
votes
1answer
84 views

UI Integration test boundaries - nested api calls

I am developing the UI of an e-commerce. Actually it is the checkout page only. The entrance URL looks like this: myEcomerce.com/{orderGuid} On load The ui takes the orderGuid as parameter to call ...
0
votes
2answers
87 views

How often should I push CRM solutions from Dev to Test in 3 week sprints?

I'm on a new CRM dev team. And simply put, I haven't seen sprint execution such a mess in my whole professional career. I have a deployment plan moving forward. I have an idea how I want continuous ...
5
votes
3answers
386 views

What is the correct approach to test classes with inheritance?

Assuming I have the following (over-simplified) class structure: class Base { public: Base(int valueForFoo) : foo(valueForFoo) { }; virtual ~Base() = 0; int doThings() { return foo; }; ...
0
votes
1answer
95 views

Given an implementation of a Service Layer and Repository layer, should you make tests of both?

Currently I have an entity called Product with the respective ProductRepository and ProductService. For ProductService, I have tests for: Read (Covering Create too) Update Delete Besides achieving ...
-2
votes
6answers
353 views

Is it good practice to have a unit test for a simple data method?

I have a simple data method that does this: public void Write(Foo foo) { db.Foos.Add(foo); db.SaveChanges(); } I was asked to write unit tests for this. To do so, I had to create a fake ...
2
votes
2answers
103 views

Object set-up for testing: Manipulate the object or use its functions?

Assuming I have the following (very simple) class class Foo { public: void setAB(int a, int b) { m_a = a; m_b = b; m_aIsBigger = a > b; } int getA() const { return m_a; } int getB() ...
0
votes
1answer
104 views

How to store large test data sets. Git? [duplicate]

We have a camera application that does measurements on pictures. We have a feature for saving a "demo" containing the pictures/data used, and to replay this for test purposes. We use such data sets ...