White-box testing is a method of testing software that tests internal structures or workings of an application as opposed to its functionality i.e. black-box testing
Questions tagged [white-box]
43 questions
2
votes
1 answer
PowerMock: Using Whitebox.invokeMethod(...) properly for a method taking an Object[] as a param
private boolean isEmpty(Object[] array) {
if (array == null || array.length == 0)
return true;
for (int i = 0; i < array.length; i++) {
if (array[i] != null)
return false;
}
return…

kchang
- 91
- 1
- 3
- 10
1
vote
0 answers
Cyclomatic Complexity Calculation on Presenter Methods and Callbacks
everyone.
I need help in determining the cyclomatic complexity regarding this tested method.
@Override
public void renderData() {
mRepository.render(new TvShowsRepositoryCallback() {
@Override
public void onRenderingData() {
…

Febryan Asa Perdana
- 11
- 1
- 1
1
vote
3 answers
should unit tests be black box tests or white box tests?
Say I have three methods, all very similar but with different input types:
void printLargestNumber(int a, int b) { ... }
void printLargestNumber(double a, double b) { ... }
void printLargestNumber(String numberAsString, String numberAsString) { ...…

Brad Cupit
- 6,530
- 8
- 55
- 60
1
vote
1 answer
how do you test simple if else statements with J-unit?
I have this if-else statement and I want to write a J unit test that will test each individual line to see is correct. Any ideas?
public class Testings {
public static int computeValue(int x, int y, int z) {
int value = 0;
if (…

Nili Chennili
- 21
- 1
1
vote
1 answer
Questions on WhiteBox testing, ON-Units, Condition-Coverage
I am reading a book where I am getting stuck at few white box testing concepts. The article in the below link is taken exactly from the book.
http://testdesigners.com/testingstyles/ControlFlowTesting.html
1.
'ON-Units' terminology is introduced…

rockbala
- 2,323
- 5
- 20
- 16
1
vote
1 answer
Does QTP support Checking the code of a Windows application?
Recently I use QTP to test a Windows application, but it can just help me recording the behavior of user-interface and I cann't find the way to inspect the inner logical structure,business procedures and how every class interacts with others through…

IT_Layman
- 337
- 4
- 17
1
vote
1 answer
unit testing Coverage Issue
my ultimate goal is to cover the below code (making complete code green). I am using cantata tool.
#define CHECK1 ((a == 1) || (a == 4))
void check_fun(int a, int b)
{
if((!CHECK1)&&(b>0)&&(b<10))
{
…

venkatesh kambakana
- 111
- 1
- 8
1
vote
3 answers
How to plan for whitebox testing
I'm relatively new to the world of WhiteBox Testing and need help designing a test plan for 1 of the projects that i'm currently working on. At the moment i'm just scouting around looking for testable pieces of code and then writing some unit tests…

Draco
- 16,156
- 23
- 77
- 92
1
vote
1 answer
How can a white box test fail, and a black box test succeed (and vice versa)?
I have an exam and trying to find an answer to this question but I am unsuccessful so far. Question is:
Give an example white box test says everything okay but black box
test says there is an error. And an example black box test says
everything…

buraktas92
- 13
- 2
1
vote
2 answers
unit tests - white box vs. black box strategies
I found, that when I writing unit tests, especially for methods who do not return the value, I mostly write tests in white box testing manner. I could use reflection to read private data to check is it in the proper state after method execution,…

Ph0en1x
- 9,943
- 8
- 48
- 97
1
vote
2 answers
Testing Approaches
I'm currently writing my dissertation and am investigating software quality and testing.
I am finding it very difficult to differentiate between the following terms and wondered if anyone can help me in doing so.
(Dynamic and Static Testing) and…

JackofAll
- 517
- 4
- 13
- 23
0
votes
0 answers
whitebox:wbt_hillshade Why are values not between 0 and 255 in R?
If you follow the tutorial here: https://vt-hydroinformatics.github.io/rgeoraster.html
I want to create a hillshade map. In general hillshade is between 0 and 255 but these values are very high. How do I interpret them?
wbt_hillshade(dem =…

Megan
- 195
- 1
- 14
0
votes
0 answers
half image haft blank white with horizontal partition in between in C# code
How can I create this image when I get a simple rectangular image using C# code.
private Bitmap MergeImages(Image image1, Image image2)
{
Bitmap bitmap = new Bitmap(image1.Width + image2.Width, Math.Max(image1.Height, image2.Height));
…

Cp Support
- 1
- 1
0
votes
2 answers
Unit test 'structure' of method?
Sorry for the long post...
While being introduced to a brown field project, I'm having doubts regarding certain sets of unit tests and what to think. Say you had a repostory class, wrapping a stored procedure and in the developer guide book, a…

jaspernygaard
- 3,098
- 5
- 35
- 52
0
votes
1 answer
No definition found for qualifier: How to solve Kotlin reflection is not available when creating modules with Koin test?
I'm trying to create a simple white-box test with Koin. After setting qualifier to pass a mock as parameter to an instance (or supposedly what I want to do) I'm receiving an error which says:
org.koin.core.error.NoBeanDefFoundException: No…

Victor Oliveira
- 3,293
- 7
- 47
- 77