Box24 casino Forum

Box24 casino.

You are not logged in.

#1 2020-09-13 06:59:07

Shawnmituany
Member
From: Costa Rica
Registered: 2020-09-13
Posts: 1

Click to share on Facebook (Opens in new window)

Black Box Unit Testing with the QT Framework

Filed under:.

— Leave a comment        March 2

2011                 Black Box testing and general testing is a key step in the iterative development methodologies (e.g.
UP, XP, Agile) as it performs both the validation and  verification  of units in a system.
Below, we quote a simple example (to familiarize yourself with the process) of black box testing in one softw are  unit called ‘Number’.

For this implementation we used the QT Framework and the QTest library

Below is the  interface  of the software unit ‘Number’: class Number {   public:     Number ();     Number (int x);     Number (Number & obj);     ~Number ();      void setValue (int x);     int getValue ();      void add (Number & obj);    private:     int x; }; Follows the implementation of the software unit ‘Number’: #include "Number.h"  Number::Number () { x = 0; }  Number::Number (int x) { this->x = x; }  Number::Number (Number & obj) { x = obj.x; }  Number::~Number () { x = 0; }  void Number::setValue (int x) { this->x = x; }  int Number::getValue () { return x; }  void Number::add (Number & obj) { x += obj.x; } Below is the interface of the control unit ‘TestNumber’: #include <QtTest>  #include "Number.h"  class TestNumber : public QObject {   Q_OBJECT    private slots:     void checkAdd ();     void checkSet ();     void checkGet (); }; Follows the implementation of the control unit ‘TestNumber’: #include "TestNumber.h"  void TestNumber::checkAdd () {   int a=3, b=2, c=a+b;   Number A (a), B (b);   B.add (A);    QVERIFY (B.getValue () == c); }  void TestNumber::checkSet () {   int a = 2;   Number A;   A.setValue (a);    QVERIFY (A.getValue () == a); }  void TestNumber::checkGet () {   int a = 2;   Number A (a);   QVERIFY (A.getValue () == a); }  QTEST_MAIN (TestNumber)           Rate this:.
Sh are  this:.
Click to sh are  on Facebook (Opens in new window).

Click to share on LinkedIn (Opens in new window)
Click to share on Twitter (Opens in new window)
Click to print (Opens in new window)
Click to email this to a friend (Opens in new window)

Like this:.
Like   Loading.
Related.
Tags: black box, , QTest, software testing, .

Unit testing    Comments RSS feed                    Leave a Reply Cancel reply

Enter  your comment  here.
Fill in your details below or click an icon to  log in :.
Email  (Address never made public)                 Name                 Website                                                            You are commenting using your  WordPress.com  account.
( Log Out /     )                                                             You  are  commenting using your Google account.
( Log Out /     )                                                             You  are  commenting using your Twitter account.
( Log Out /     )                                                             You are commenting using  your Facebook  account.
( Log Out /     )                             Cancel    Connecting  to %s             Notify me of new comments via email.
Notify me of new posts via email.
«  Presentation  at T.
E.
I.

Of Central Macedonia with topic “Genetic Routing”

“Hello World” example program in  ass embly language.
».
(79).
(21).
(15).
(26).
(4).
(7).
(55).
(24).
(4).
(16).
(14).
(4).
(7).
(10).
(78).
(11).
(9).
(1).
March 2011      M  T  W  T  F  S  S           123456      78910111213      14151617181920      21222324252627      28293031           « Feb     May ».
(2).
(4).
(1).
(1).
(2).
(1).
(1).
(1).
(2).
(1).
(9).
(1).
(8).
(1).
(1).
(2).
(4).
(7).
(1).
(1).
(1).
(8).
(12).
(1).
(2).
(1).
(2).
(1).
(2).
(1).
(1).
(4).
(20).
(13).
(5).
(2).
(10).
(13).
(10).
(10).
(20).
287,006 hits.
Send to Email Address           Your Name        Your Email Address                              Cancel       Post was not sent - check your email addresses.
Email check failed.

Please try again          Sorry

your blog cannot share posts by email.
%d  bloggers like this:.

Offline

Board footer

Powered by FluxBB