Date Archives February 2018

Down Call vs. Up Call

downcall_upcall

Down Call

  • User code(unprivileged) enters to kernel with trap(interrupt).

Up Call

  • Kernel(privileged) enters to user code with IPC(Interprocess Communication).

 

White Box, Black Box, and Gray Box

black_and_white

In software testing, there are three different types of testing depending on how much knowledge the testers have on the software being tested.

White Box Testing

  • With full knowledge of the software. (internal structures, source codes, etc.)
  • Usually tests how the software performs.
  • Suitable for software developers.

Black Box Testing

  • Without having any knowledge of the software. (internal structures, source codes, etc.)
  • Usually tests for functionality of the software.
  • Suitable for third-party testers.

Gray Box Testing

  • Test with partial knowledge of the software.

Testing Methods

test

These are currently popular methods to test software.

Fuzz Testing

  • Input massive invalid, unexpected, or random data(Fuzz) to find errors or vulnerabilities in the software.
  • Effective on blackbox testing

 

Stochastic Testing

  • Input random sequence of datas 

 

Model-based Testing

  • Generates meaningful test case models which can detect errors on the desired behavior.

 

Symbolic Testing

  • Replace inputs of program with symbolic variables.
  • Find the feasibility of all paths in the program.
  • Quite expensive for finding feasibility of path.
x = read();
if (x > 3) {
  y = 1;
  if (x < 0)
    y = 2;
} else y = 3;

After changing with symbolic variables, it checks the feasibility of paths. On above example, the expression (y = 2; on line #5) will not be reached.

 

Concolic Testing (Concrete + Symbolic)

  • Input actual concrete value to the program, then generate new input by changing the path condition.
  • Less expensive then Symbolic testing.

What does the symbol ‘&’ mean in C and C++?

ampersand

‘&’ symbol has two meanings in C and C++.

  • Address of Operator: returns address of a variable.
    • int a = 3;
    • printf(“%d”, a);
      • will return value of a: 3
    • printf(“%d”, &a);
      • will return address of variable a.

 

  • Bit-wise Operator &: operates on bitlevel
    • Example:table_bitwise_operator
    • int a = 13&4;
      • 13 = 1101
      • 4  =0100
      • 13&4 = 0100
      • a = 4