How does a desktop environment developer test his code?

333 views Asked by At

I can't figure out how a desktop environment developer test his code. Usually, a C or C++ programmer compiles his code an then run it (i'm not one of those programmers, i'm a web one). So, you usually build your gui application over some kind of desktop environment (windows, mac os x, gnome, kde, xfce...), sow how they build and test their gui desktop?

And if this is a silly question, how does a kernel programmer test his code? for example linux kernel? how do you know that what you just wrote works?

3

There are 3 answers

1
egur On

Testing is a very broad term there are many types (partial list):

  • unit tests - test small pieces of code. test that the code behaves as expected.
  • system tests - test whole application in real world scenarios.
  • performance tests - test what is the performance of the application or part of it.
  • GUI testing - test operation of GUI elements (not so common as automated tests)
  • static analysis - compiler warnings on steroids
  • dynamic analysis - at a minimum memory checks - check mem allocations and usage
  • coverage tests - check that all code is executed.
  • formal verification tests (very advanced) - e.g. check when assertions/assumptions are broken.

Kernel code can be debugged by connecting using a 2nd computer (host). Virtual machines uses the same principal and simplify the setup but can't always work as HW might not exist in the guest VM. The kernel (all OSes) has trace mechanism(s) for printing progress/problems. In Linux the simple trace is shown via the dmesg command (prints a cyclic buffer).

User mode code can easily be stopped and debugged via a debugger.

2
AudioBubble On

Desktop Environments

Testing Desktop Environments in real world scenarios can be kind of annoying, so the developer would have to watch out for every small error he makes, if he doesn't, he will have a hard time developing the DE.

As stated by @egur, there are multiple ways of testing his code, the easiest one and most important (but cannot be used in some cases, of course), he can test that code in a simplified program.

A Desktop Environment consists of many parts, however, in your case, I suppose you're talking about the session manager (or window manager) which is responsible for almost everything. So, if he were to test that, he would simply exit his current DE and use the new executable. In case of some error, he can always keep a backup of the old executable or fix the faulty code using some commandline text editor (like vim, or nano).

Kernel

It's quite hard to test, some kernel developers just write some code and make sure it's fine and compiles, then simply let his users test (by ACK'ing the code, etc.), then it can be submitted into the kernel code. Reasoning behind that is, the developer may not have the hardware needed to test the code.

Right now, you can compile and run the kernel in usermode (UML) if you have heard of it, so some developers may go for it. However, some developers may also want to test it themselves (They of course back up the current kernel incase of a screw up).

0
alvaropg On

The way to test a desktop application is related to the way of control the application unassisted or remotely.

The Cross Platform GUI Test Automation tool (I don't know if this project has a web) project helps you to chose the interfaces/libraries required to solve the problem.

In Linux[1] uses the accessibility libraries to control the application, you have Cobra[2] for Windows and PyATOM[3] for MacOS, but I don't know what kind of technology uses in this platforms.

  1. http://ldtp.freedesktop.org/wiki/
  2. https://github.com/ldtp/cobra
  3. https://github.com/pyatom/pyatom