XML Document for an Order - Universität Koblenz · Landau

Werbung
OBST
XMLT
XML Integration Testing
1
XML Portals connect distributed Components
15 Data Structure of an Order
2
Composition of a Component
16 Order Test Procedure
3
Component Integration Testing
17 DTD for an Order
4
Web-based Test Environment
18 XML Document for an Order
5
XML Testbed
19 Order Test Data
6
XML Document Type Defintion
20 Customer Test Procedure
7
Structure of an XML Interface
21 Customer Test Data
8
XML Connectors
22 Article Test Procedure
9
XML Data Tree
23 Article Test Data
10 A Letter as a Data interchange Protocol
24 Invoice Test Procedure
11 Development of an XML Interface
25 DTD for an Invoice
12 Interface Test Cycle
26 XML Document for an invoice
13 Sample Order Entry Interfaces
27 Sample Invoice
14 Object Structure of an Order Entry System
28 Summary
OBST
XMLT-1
XML Portals connect distributed Components
-------------
-------------
-------------
Component
Component
Component
Data
Data
Component
Component
Data
Data exchange in
Form of XML
Documents
Data
Component
Component
Data
Data
Component
Data
OBST
XMLT-2
Composition of a Component
-------------
XML Input
Documents
XML Reader
Class
Import
Classes
Gui
Classes
1
Processing
Classes
Access
Class
XML Writer
Class
1
Export
Classes
Access
Class
Persistent Objects
XML Output
Documents
OBST
XMLT-3
Component Integration Testing
Predecessor
Component
Component under Test (CUT)
XML
Import
Component
Testdata are
generated or
edited or replayed
from a previous test
XML
Export
Test Results are scanned or
validated or recorded for
future use
Successor
Component
Testing the Interfaces between distributed Components
OBST
XMLT-4
Web-based Test Environment
HTML
Front End
Back End
Test
Work Station
HTML
Web
Work Station
Client
Components
XML
Generator
XML
Documents
Message
Queue
XML
Documents
XML
Validator
Server
Components
XML
Documents
SOAP
MQ-Series
Database
OBST
XMLT-5
XML Testbed
Test
data
Expected
Results
Generator
Validator
XML Instances
XML
XML
Document
XML
Document
Validation
Report
Comparison
Component
Import
Export
Base
Class
Sub
Class
Test
data
Generator
1
*
SQL
Sub
Class
SQL
Database
Validator
Validation
Report
OBST
XMLT-6
XML Document Type Defintion
XML Declaration
Prolog
?
Stylesheet Reference
DOCTYPE_Declaration
[Reference to external DTD Subset]
[internal DTD Subset]
Stylesheet
(XSL, CSS)
external
DTD_Subset
XML-Daten
<Entity>
XML
Document
<Attributes>
external Data
(Entity)
<Attributes>
external Data
(Entity)
<Attributes>
external Data
(Entity)
</Entity>
valid
Instance
+
<Entity>
</Entity>
<Entity>
</Entity>
OBST
XMLT-7
Structure of an XML Interface
<!DOCTYPE name [
<!ATTLIST elementname (attributename attributetype presetting)>
attributetype
:= (CDATA | ID | IDREFS |
ENTITIY | ENTITIES |
NMTOKEN | NMTOKENS |
NOTATION (name (I name)...)
presetting
:= (#REQUIRED | #IMPLIED | [#FIXED]) Value
wert
:= (“literal" | ‘literal' | entity_reference)
<!ELEMENT name contentmodel>
<contentmodel
:= EMPTY | ANY | data | modelgroup | mixed
data
:= (#PCDATA)
modelgroup
:= (Connector | sequence) [?|*|+]
]
OBST
XMLT-8
XML Connectors
Connectors:
,
z.B. X,Y
=
Sequence X and Y
|
z.B. X|Y
=
or
X or Y
?
z.B. X?
=
optional
X can occur optionally
+
z.B. X+
=
1:n
X can occur 1 to n times
*
z.B. X*
=
0:n
X can occur 0 to n times
OBST
XMLT-9
XML Data Tree
Interface
Header
Body
Footing
+
Elem
Elem
Elem
Elem
Group
Elem
|
?
Elem
?
Elem
Elem
Elem
Elem
OBST
XMLT-10
A Letter as a Data Interchange Protocol
Letter
?
Reference
*
Date
Address
+
Name
Receiver
Text
Greeting
Sender
+
Street
City
?
Name
Title
OBST
XMLT-11
Development of an XML Interface
Request
Interface
Analyzer
Document Type Definition (DTD)
or a Schema (XSD)
Req.Analysis
Document
Analysis
Interface
Specification
DTD
Designer
Structure
Design
Document
Design
XML
Parser
XML
Generator
XML-DTD
XML
Editor
Test
OBST
XMLT-12
Interface Test Cycle
Results
Arguments
Tester
Tester
Enter
expected
Results
Enter
Testdata
Actual
Inputs
Generate
Input Documents
Expected
Outputs
Generate
Output Documents
Capture/Replay
Storage
Feedback
XML
Document
Generator
Store
Test
XML
Document
Validator
Comparison
Report
OBST
XMLT-13
Sample Order Entry Interfaces
Header
Items
Customer
Customer
Order
Class
Customer
Class
SQLTab.
Invoice
XML
Document
Article
Class
Customer
Data
SQLTab.
Article
Data
Billing
Class
OBST
XMLT-14
Object Structure of an Order Entry System
Order
+
Order
number
Customer
number
Delivery
mode
Delivery
date
Item
number
Customer
Order
Item
Article
number
Item
amount
?
Customer
number
Customer
address
+
Name
Customer
creditrate
Customer
points
Article
+
Street
City
Article
number
Article
name
Article
amount
Article
price
Minimum
amount
OBST
XMLT-15
Data Structure of an Order
Order
Customer
number
Customer
address
Order
number
Date
Nr_Items_
ordered
+
Name
Items
+
Street
City
Day
Month
Order
Item
Year
Item
number
Article
number
Item
amount
OBST
XMLT-16
Order Test Procedure
XML.Object:: Order
{ assert pre CustomerNr
}
= range (00000001:99999999);
assert pre OrderNr
= range (1+1);
assert pre OrderDate
= Day, Month, Year;
assert pre Day
= range (01:31);
assert pre Month
= range (01:12);
assert pre Year
= range (00:99);
assert pre Nr_Items_ordered
= set (1, 5, 9);
assert pre OrderItem [1:9]
= ItemNr, ArticleNr, itemAmount);
assert pre ItemNr
= range (1+1);
assert pre ArticleNr
= set (0, 400, 650, 900, 942, 969, 988, 999);
assert pre ItemAmount
= range (1+99);
OBST
XMLT-17
DTD for an Order
<?xml version = '1.0'?>
<!DOCTYPE Auftrag [
<!--* Customer Order for Underwear
*-->
<!ELEMENT Order
(CustomerNumber,
OrderNumber,
OrderDate,
Nr_Items_ordered,
OrderItem*)>
<!ELEMENT CustomerNr
(#PCDATA)>
<!ELEMENT OrderNr
(#PCDATA)>
<!ELEMENT OrderDate
(Day, Month, Year)>
<!ELEMENT Day
(#PCDATA)>
<!ELEMENT Month
(#PCDATA)>
<!ELEMENT Year
(#PCDATA)>
<!ELEMENT Nr_Items_ordered
(#PCDATA)>
<!ELEMENT OrderItem
(ItemNr, ArticleNr, ItemAmount)>
<!ELEMENT ItemNr
(#PCDATA)>
<!ELEMENT ArticleNr
(#PCDATA)>
<!ELEMENT ItemAmount
(#PCDATA)>
]>
OBST
XMLT-18
XML Document for an Order
<Order>
<CustomerNr>00000001</CustomerNr>
<OrderNr>000001</OrderNr>
<OrderDate>
<Day>01</Day>
<Month>03</Month>
<Year>00</Year>
</OrderDate>
<Nr_Items_ordered>3</Nr_Items_ordered>
<Order_Item>
<ItemNr>1</ItemNr>
<ArticleNr>969</ArticleNr>
<ItemAmount>1</ItemAmount>
</Order_Item>
<Order_Item>
<ItemNr>2</ItemNr>
<ArticleNr>942</ArticleNr>
<ItemAmount>100</ItemAmount>
</OrderItem>
<OrderItem>
<ItemNr>3</ItemNr>
<ArticleNr>988</ArticleNr>
<ItemAmount>199</ItemAmount>
</OrderItem>
</Order>
OBST
XMLT-19
Order Test Data
CustomerNr
OrderNr
OrderDate
Items_
ordered
Day Mon Year
00000001
00126254
99999999
000001
00000000
00000000
01
02
03
03
03
03
00
00
00
OrderItems
Nr ArtNr ArticleName
3
2
5
ItemAmount
1
969
Büstenhalter
1
2
942
Straps
100
3
988
Slip
200
1
650
Panties
300
2
400
Unterrock
400
1
942
Straps
500
2
969
Büstenhalter
999
3
988
Slip
999
4
650
Panties
999
5
400
Unterrock
999
OBST
XMLT-20
Customer Test Procedure
SQL.Object:: Customer
{ assert pre CustomerNr
}
= range (00000001:99999999);
assert pre CusomerAddress
= Name, Street, Zip, City;
assert pre Name
= set ("Feldbusch, Verona",
"Schiffer, Claudia",
"Illner, Maybritt",
"Christiansen, Sabine",
"Buster, Dolly");
assert pre Street
= set ("Eroticastr. 9",
"Modellstr. 66",
"Ossistr. 89",
"Wessistr. 49",
"Pornostr. 77");
assert pre Zip
= set ("55555", "44444", "11111", "22222", "66666");
assert pre City
= set ("Koeln",
"Duesseldorf",
"Berlin",
"Hamburg",
"Prag");
assert pre Credit
= set (1, 2, 3, 4, 0);
assert pre Points
= range (1000 + 1000);
OBST
XMLT-21
Customer Test Data
CustomerNr
CustomerAddress
Name
Street
Zip
Credit
Points
City
00000001
Feldbusch, Verona
Eroticastr. 9
55555 Köln
1
1000
00126254
Schiffer, Claudia
Modellstr. 66
44444 Düsseldorf
2
1500
11117777
Illner, Maybritt
Ossistr. 89
11111 Berlin
3
2000
55555555
Christiansen, Sabine
Wessistr. 49
22222 Hamburg
4
4000
99999999
Buster, Dolly
Pornostr. 77
66666 Prag
0
0
OBST
XMLT-22
Article Test Procedure
SQL:Object:: Article
{ assert pre ArticleNr
= set (400, 650, 942, 969, 988, 999);
assert pre ArticleName
= set ("Unterrock",
"Panties",
"Straps",
"Büstenhalter",
"Slip",
"Bluse");
assert pre ArticlesonStock
= range (1000 - 100);
assert pre ArticlePrice= range (0 + 99,99);
}
assert pre MinimumAmount
= range (100 + 100);
assert post ArticlesonStock
if (ArticlesonStock
= ArticlesonStock - Order.OrderItem.ItemAmount
> Order.OrderItem.ItemAmount);
assert post BackOrderSwitch
= 1 if (ArticlesonStock < MinimumAmount);
OBST
XMLT-23
Article Test Data
ArticleNr
ArticleName
ArticlesonStock
ArticlePrice
MinimumAmount
500
199,99
100
400
Unterrock
650
Panties
1500
59,99
500
942
Straps
1000
99,99
500
969
Büstenhalter
600
82,50
200
988
Slip
300
150,00
200
999
Bluse
200
150,40
200
OBST
XMLT-24.1
Invoice Test Procedure
XML.Object:: Invoice
{ assert post InvoiceNr
= set (1:9999);
assert post InvoiceDate
= Day, Month, Year;
assert post Day
= OrderDate.Day;
assert post Month
= OrderDate.Month;
assert post Year
= OrderDate.Year;
assert post DueDate
= DueDay, DueMonth, DueYear;
assert post DueDay
= Day + 15
if (Day < 16 & Month != 2);
assert post DueDay
= Day - 15
if (Day < 15 & Month != 2);
assert post DueDay
= Day + 14
if (Day > 15 & Month = 2);
assert post DueDay
= Day - 14
if (Day > 14 & Month = 2);
assert post DueMonth
= Month
if (Day < 16 & Month != 2) | (Day < 15 & Month = 2));
assert post DueMonth = Month + 1
if (Day > 15 & Month != 2) | (Day > 14 & Month = 2) & (Month < 12));
assert post DueMonth
=1
if (Day > 15 & Month = 12);
OBST
XMLT-24.2
assert post DueYear
= Year
if (Month < 12) | (Month = 12 & Day < 16);
assert post DueYear
= Year + 1
if (Month = 12 & Day > 16);
}
assert post BillingItem
= ArticleNr, Articlename, ArticlePrice, ItemAmount, ItemPrice;
assert post ArticlePrice
= ArticleNr -> Article.ArticlePrice;
assert post ItemAmount
= OrderNr -> Order.ItemNr -> OrderItem.ItemAmount;
assert post itemPrice
= ArticlePrice * ItemAmount;
assert post TotalPrice
= sum (ItemPrice [1:9];
assert post SalesTax
= TotalPrice * TaxRate;
asssert post AmouuntDue
= TotalPrice + SalesTax;
OBST
XMLT-25
DTD for an Invoice
<?xml version = '1.0'?>
<!DOCTYPE Invoice [
<!--* Invoice for a Customer Order
*-->
<!ELEMENT Invoice
<!ELEMENT InvoiceNr
<!ELEMENT CustomerName
<!ELEMENT InvoiceDate
<!ELEMENT DueDate
<!ELEMENT Day
<!ELEMENT Month
<!ELEMENT Year
<!ELEMENT BillingItem
<!ELEMENT ArticleNr
<!ELEMENT ArticleName
<!ELEMENT ArticlePrice
<!ELEMENT ItemAmount
<!ELEMENT ItemPrice
<!ELEMENT TotalPrice
<!ELEMENT SalesTax
<!ELEMENT AmountDue
( InvoiceNr,
CustomerName,
InvoiceDate,
DueDate,
BillingItem+,
TotalPrice,
SalesTax,
AmountDue)>
(#PCDATA)>
(#PCDATA)>
(Day, Month, Year)>
(Day, Month, Year)>
(#PCDATA)>
(#PCDATA)>
(#PCDATA)>
(ArticleNr, Articlename, ArticlePrice, ItemAmount,
ItemPrice)>
(#PCDATA)>
(#PCDATA)>
(#PCDATA)>
(#PCDATA)>
(#PCDATA)>
(#PCDATA)>
(#PCDATA)>
(#PCDATA)> ]>
OBST
XMLT-26.1
XML Document for an Invoice
<Invoice>
<InvoiceNr>0001</InvoiceNr>
<CustomerName>Feldbusch,Verone</CustomerName>
<InvoiceDate>
<Day>01</Day>
<Month>03</Month>
<Year>00</Year>
</InvoiceDate>
<DueDate>
<Day>16</Day>
<Month>03</Month>
<Year>00</Year>
</DueDate>
<BillingItem>
<ArticleNr>969</ArticleNr>
<Articlename>Buestenhalter</Articlename>
<ArticlePrice>82,50</ArticlePrice>
<ItemAmount>1</ItemAmount>
<ItemPrice>82,50</ItemPrice>
</BillingItem>
OBST
XMLT-26.2
<BillingItem>
<ArticleNr>942</ArticleNr>
<Articlename>Straps</Articlename>
<ArticlePrice>99,99</ArticlePrice>
<ItemAmount>100</ItemAmount>
<ItemPrice>9999,00</ItemPrice>
</BillingItem>
<BillingItem>
<ArticleNr>988</ArticleNr>
<Articlename>Slip</Articlename>
<ArticlePrice>150,00</ArticlePrice>
<ItemAmount>200</ItemAmount>
<ItemPrice>30000,00</ItemPrice>
</BillingItem>
<TotalPrice>40081,50</TotalPrice>
<SalesTax>6413,04</SalesTax>
<AmountDue>46494,54</AmouuntDue>
</Invoice>
OBST
XMLT-27
Sample Invoice
Invoice Nr: 0001
Invoice Date: 01.03.00
Customer Name: Feldbusch, Verona
Due Date:
ArticleNr
Articlename
ArticlePrice
16.03.00
ItemAmount
itemPrice
969
Büstenhalter
82,50
1
82,50
942
Straps
99,99
100
9999,00
988
Slip
150,00
200
30000,00
Total Price:
40081,50
Sales Tax:
6413,04
Amount Due:
46494,54
OBST
XMLT-28
Summary
 Analyize the Component Interactions & Interfaces
 Specifiy the Input Testdata Procedures
 Specifiy the Output Validation Procedures
 Generate the XML Testdata Documents
 Execute the Test
 Validate the XML Output Documents
 Control the Interface & Interaction Coverage
Herunterladen