Pokazywanie postów oznaczonych etykietą testowanie. Pokaż wszystkie posty
Pokazywanie postów oznaczonych etykietą testowanie. Pokaż wszystkie posty

czwartek, maja 22, 2014

VAT - Validation of Architecture in Tests

1. Flood test / capacity test
We call component with assumed load, see distribution of response times (min, max, avg, med, 80 percentile, 95 percentile, 99 percentile) - are they deterministic. We increase load linearly up to 10x (one order of magnitude higher) and monitor performance. Components should be able to be tuned to handle load 2x higher than current business requirement. Tests should define limits when below application is still responsive and above crashes.
2 Duplicates test
We call services with duplicated messages and check handling of duplicates. Application may not recognize duplicates, may throw errors due to detection of repeating unique ids and may accept duplicates, but internally skip processing of them. Tests should check for not aimed data multiplication and stalled flows due to rejected duplicates errors.
3 Timeout test
We inject long sleep activities and check timeout handling. We look for snowball effect (backlog aggregation due to repeating on timeout), not defined capacity limits causing whole components/flows to be stucked/failing with OutOfMemory errors, overloaded components and servers.
4 Kill & restart test
We kill and restart whole application/(application) servers. We look for missing (lost) data, duplicates and other inconsistencies. We verify transactional requirements and actual implementation.
5 Error injection and negative path
We inject errors inside process execution and check for missing error handlers. We verify error codes to see if they match actual exception. We also verify assigned error categories (business, technical, repeatable, non-repeatable).
6 Logging test
We check if logging works, payloads are available and we have enough file/database storage. We check if flows are traceable using log frontend.
7. Active-Active, Active-Standby
We kill components and check switching between endpoints. We measure times and verify against configured application timeouts. We detect weak points / single points of failure, recovery errors. It is important to test all possible permutations, with various timings etc. We should create and execute test case when whole HA infrastructure does not deliver working HA for connected applications.
8. Poller test
We run many pollers at once and check if they are protected against working in multithreading. We configure limits to comply with singleton design or implement missing (b)locking. We check data consistency/duplication.
9  Data republication
We check if data republication is possible, how to trigger it, how to detect republication from external systems, how to protect against flood/snowball effect/not controllable backlog.
10  Long term stability test
We execute normal load tests for 24/48/72 hours and check for any stability issues caused by daily IT usage patterns.

czwartek, maja 08, 2014

JMS Topics as a foundation for distributed tests

Runnable jar file is published to topic. Clients pick it up, run, and redirect output to reply topic.

środa, kwietnia 30, 2014

Testing of EMS XA

There are so many permutations and potentially many different circumstances (hardware, HDD vs SSD, OS, network, load, etc.) that you should not rely on manual testing. Write simple wrapper around tibemsd and XA transaction and do automatic tests. EMS server can be started locally by creating process from Java ProcessBuilder, disabled with simple JMS message, killed. With simple API you can test variety of different cases and verify your enviroment/expectations/scenarios. When your EMS cluster crushes someone for sure will ask you: 'Have you ever verfied your HA?'. It is wise to be prepared.


poniedziałek, marca 31, 2014

Unit Tests in Tibco

  • Replace Global Variables in runtime using XML file crafted per test environment/project.
  • Read processes from Test folder of BW project repository
  • For each called process gather thrown errors/assertions
  • Return simple report containing process names and execution status: OK, ERROR (with stacktrace)
  • If you run this sequence on component startup and integrate with logging subsystem/framework, you will get unit tests run on every deployment


piątek, września 16, 2011

Java, SAP i Tibco

Do przetestowania adaptera outboundowego Tibco SAP R3 wcale nie jest potrzebny SAP. W testach automatycznych można wykorzystać kod Javy i konektor SAP JCo - ten sam, którego używa Tibco Designer.

poniedziałek, września 12, 2011

Matematyka w projektach

Przy 10-ciu systemach w projekcie i dostępności każdego wynoszącej 80% wynikowa dostępność to trochę ponad 10%! 0.8^10 = 10.74%. Zakładając, że do całkowitego wykonania testów potrzebna jest wynikowa dostępność 99%, przy dostępności pojedynczego systemu 80% zamiast 99,9% potrzeba 10 razy więcej czasu na testy. Jeśli testy projektu z dużą liczbą systemów, zamiast trwać miesiąc przeciągają się do dziesięciu miesięcy, to jest na to racjonalne uzasadnienie. Dlatego należy dbać o środowiska testowe.

piątek, sierpnia 26, 2011

Ultimate SOA testing tool



SoapUI 4.0

poniedziałek, sierpnia 15, 2011

Generator danych testowych

http://www.bogus.ovh.org/generatory/all.html - biznes może sobie wyklikać NIP, PESEL, REGON, dowód osobisty.

wtorek, maja 10, 2011

O dużych projektach

Zakładam, że duży projekt to taki, w którym integrowane są minimum 3 systemy. W projektach z dużą liczbą systemów najwięcej czasu pochłaniają testy. Harmonogram testów powinien być ustalany z dużym wyprzedzeniem i zatwierdzany na wszystkich szczeblach począwszy od samej góry do dewelopera, który ma uczestniczyć w testach, i jego zastępcy (zawsze należy mieć dodatkowego człowieka). Uczestnicy testów najpóźniej dzień przed zorganizowaną akcją powinni być biegle obeznani w artefaktach (XSD, WSDL, etc) i dokumentacji. Powinni być także zarezerwowani deweloperzy zdolni do zidentyfikowania i naprawienia błędów. Przypadki testowe powinny być jak najbardziej równoległe tzn. błąd w jednym obszarze testów nie powoduje przestoju tylko przejście do innej puli testów. Podczas testów do dyspozycji powinny być wszystkie zespoły, które brały udział w projekcie. Stworzenie takiego harmonogramu wymaga ekwilibrystyki i dobrych zdolności negocjacyjnych oraz zapłacenia chwilowo bezczynnym ludziom za bycie w "stanie gotowości". Wykrycie krytycznego błędu uniemożliwiającego testy powinno skutkować ich przerwaniem i zaplanowaniem harmonogramu od nowa. W ostatecznym rozrachunku testy przeprowadzone w ten sposób będą zrobione szybciej i taniej.

czwartek, czerwca 18, 2009

Automatyczne testowanie aplikacji webowych

"Przechodzimy" aplikację w Firefoksie wyposażonym w plugin "Live HTTP headers" i kopiujemy dane wysyłane formularzem. Dane te wkleimy potem do linii poleceń wgeta.



Przykładowy skrypt:
WP_URL="http://10.10.1.20:8080/app/AppServlet"
COOKIE="cookie.dat"
WGET_CMD="wget --timeout=15 --keep-session-cookies --save-cookies=$COOKIE --quiet $WP_URL -O -"
> $COOKIE

RUNNING=$(ps uax | grep -c nazwa_skryptu.sh)
[[ $RUNNING -gt 3 ]] && echo "Poprzednie wywolanie skryptu wisi" && exit 1

RES=$($WGET_CMD --post-data="user=jan.kowalski&password=lubieTpsa&action=login" | grep -c "Zalogowany: ")
echo "Test logowania. Wynik: $RES"
RES=$($WGET_CMD --load-cookies=$COOKIE --post-data="action=create-process&action_params=...&state=" | grep -c "Nowy proces")
echo "Zaladowanie procesu. Wynik: $RES"
RES=$($WGET_CMD --load-cookies=$COOKIE --post-data="action=next&action_params=..." | grep -c "Dane zapisano")
echo "Wynik procesu poprawny?: $RES"
RES=$($WGET_CMD --load-cookies=$COOKIE --post-data="action=save-and-close&action_params=..." | grep -c "Zakonczono proces")
echo "Zamkniecie procesu. Wynik: $RES"
RES=$($WGET_CMD --load-cookies=$COOKIE --post-data="action=logout" | grep -c "Wylogowano uzytkownika")
echo "Wylogowanie. Wynik: $RES"

środa, marca 18, 2009

CruiseControl

Narzędzie do ciągłej integracji: pobiera projekt z SVN-a, kompiluje, zapuszcza testy JUnit, buduje jar-y.



Jak naprościej zacząć? Ściągnąć binarną dystrybucję, w katalogu projects wycheckoutować swój projekt z SVN-a i stworzyć plik build.xml (przykładowa zawartość poniżej):

<project name="wppm3" default="all">
<path id="classpath">
<fileset dir="lib">
<include name="util/junit.jar"/>
<include name="jdom/jdom.jar"/>
<include name="jdom/xstream.jar"/>
<include name="jdom/commons-jxpath-1.3.jar"/>
<include name="weblogic/weblogic.jar"/>
<include name="weblogic/wl-extra.jar"/>
<include name="weblogic/wlclient.jar"/>
<include name="weblogic/wls-api.jar"/>
<include name="weblogic/wljmsclient.jar"/>
<include name="weblogic/javax.servlet_1.0.0.0_2-5.jar"/>
<include name="xerces/xerces.jar"/>
<include name="oracle/xmlparserv2.jar"/>
<include name="oracle/xdb.jar"/>
<include name="oracle/ojdbc14.jar"/>
<include name="oracle/orai18n.jar"/>
<include name="castor/castor-1.0.3.jar"/>
<include name="castor/castor-1.0.3-xml.jar"/>
<include name="Microsoft SQL Server 2005 JDBC Driver/sqljdbc_1.0/enu/sqljdbc.jar" />
</fileset>
</path>

<target name="all" depends="clean, compile, sleep, test, jar"/>

<target name="clean">
<delete dir="target" quiet="true" />
</target>

<target name="compile">
<exec executable="svn">
<arg line="up"/>
</exec>

<mkdir dir="target/classes"/>
<javac srcdir="src" destdir="target/classes">
<classpath refid="classpath"/>
</javac>
</target>

<target name="sleep">
<echo message="Sleeping for a while so you can see the build in the new dashboard" />
<sleep seconds="10" />
</target>

<target name="test" depends="compile">
<mkdir dir="target/test-results"/>
<junit haltonfailure="no" printsummary="on">
<classpath>
<pathelement location="target/classes"/>
<pathelement location="target/test-classes"/>
<pathelement location="lib/junit.jar"/>
<pathelement location="lib/util/junit.jar"/>
<pathelement location="lib/jdom/jdom.jar"/>
<pathelement location="lib/jdom/xstream.jar"/>
<pathelement location="lib/jdom/commons-jxpath-1.3.jar"/>
<pathelement location="lib/weblogic/weblogic.jar"/>
<pathelement location="lib/weblogic/wl-extra.jar"/>
<pathelement location="lib/weblogic/wlclient.jar"/>
<pathelement location="lib/weblogic/wls-api.jar"/>
<pathelement location="lib/weblogic/wljmsclient.jar"/>
<pathelement location="lib/weblogic/javax.servlet_1.0.0.0_2-5.jar"/>
<pathelement location="lib/oracle/xmlparserv2.jar"/>
<pathelement location="lib/oracle/xdb.jar"/>
<pathelement location="lib/oracle/ojdbc14.jar"/>
<pathelement location="lib/oracle/orai18n.jar"/>
<pathelement location="lib/castor/castor-1.0.3.jar"/>
<pathelement location="lib/castor/castor-1.0.3-xml.jar"/>
<pathelement location="lib/Microsoft SQL Server 2005 JDBC Driver/sqljdbc_1.0/enu/sqljdbc.jar" />
</classpath>
<formatter type="brief" usefile="false"/>
<formatter type="xml" />
<batchtest todir="target/test-results" >
<fileset dir="target/classes" includes="com/nordea/junit/**/*Test*.class"/>
</batchtest>
</junit>
</target>

<target name="jar" depends="compile">
<jar jarfile="target/wppm3.jar" basedir="target/classes"/>
</target>
</project>

Jeszcze trzeba w konfiguracji narzędzia obok projektu demonstracyjnego dodać ten nasz (a tamten skasować).