Richtig loggen
- java.util.logging formatiert Zahlen je nach locale!
- Zeiten loggen in UTC!
- Zahlen mit Einheiten, immer kleinst mögliche Einheit
Java libs / Tools
- Metrics
Java-Lib zum erfassen/loggen von Metriken
- Logstash
Input ( log-Dateien ) --> Filter ( Deklarativ ) --> Output
- collectd
Sammelt Daten des Servers ( Load, Speicherauslastung, CPU .... )
Auswertung:
- Kibana ( Web-Oberfläche, Bestandteil von ElasticSearch )
- GrayLog ( Web-Oberfläche, basierend auf Lucene )
Freitag, 4. April 2014
Donnerstag, 3. April 2014
BedCon 2014 Testen im EE-Umfeld
BedCon 2014
Feige sein!
Testen im EE-Umfeld
- Integrationstests auf produktiv-gleichen Application-Server
- Apache DeltaSpike als CDI Container Wrapper in (Multi-)Unit-Tests
- BUnit für Testdatenbereitstellung in die Datenbank ( kleinere Datenmengen )
- Testdaten einspielen:
- vor dem Test: erst löschen
- dann einspielen
- nach dem Test: stehen lassen ( zur möglichen Kontrolle )
- Integrationstest: Arquillian ( JBoss )
Feige sein!
Testen im EE-Umfeld
- Integrationstests auf produktiv-gleichen Application-Server
- Apache DeltaSpike als CDI Container Wrapper in (Multi-)Unit-Tests
- BUnit für Testdatenbereitstellung in die Datenbank ( kleinere Datenmengen )
- Testdaten einspielen:
- vor dem Test: erst löschen
- dann einspielen
- nach dem Test: stehen lassen ( zur möglichen Kontrolle )
- Integrationstest: Arquillian ( JBoss )
BedCon2014 - ATDD
BedCon2014
Acceptance Test Driven Development
- Cucumber
- feste Szenario Syntax in beliebigen Sprachen
- Java Testcode Methoden pro TestSyntax-Satz in anderer Klasse, Kopplung per Annotation
- als Junit Test ausführbar
- Ausführung des gleichen Tests mit verschiedenen Parametern per Parameter-Liste als ASCII Tabelle
- Jnario
- gleiche Szenario Syntax
- Test-Code wird nicht per Annotation an den Testsatz gebunden ( Cubumber ) sondern direkt in das Szenario Dokument. Daher: Keine Wiederverwendbarkeit von Test-Code-Snippets!
- weiteres Feature: Spezifikations-Tests als DSL, auch als JUnit ausführbar
- Nat-Spec ( kommerziell! )
- gleiche Szenario Syntax als DSL, Sprache beliebig
- Java Testcode Methoden pro Test-Satz in anderer Klasse, Kopplung per Annotation
- als Junit Test ausführbar
- neue Test-Sätze sind automatisch generierbar per Eclipse Hilfe
- Ausführung des gleichen Tests mit verschiedenen Parametern per Parameter-Liste als ASCII Tabelle
- Weiteres Feature:
- Geschäftsregeln definieren,
- Datenmodell generieren,
- Oberflächen generieren
Acceptance Test Driven Development
- Cucumber
- feste Szenario Syntax in beliebigen Sprachen
- Java Testcode Methoden pro TestSyntax-Satz in anderer Klasse, Kopplung per Annotation
- als Junit Test ausführbar
- Ausführung des gleichen Tests mit verschiedenen Parametern per Parameter-Liste als ASCII Tabelle
- Jnario
- gleiche Szenario Syntax
- Test-Code wird nicht per Annotation an den Testsatz gebunden ( Cubumber ) sondern direkt in das Szenario Dokument. Daher: Keine Wiederverwendbarkeit von Test-Code-Snippets!
- weiteres Feature: Spezifikations-Tests als DSL, auch als JUnit ausführbar
- Nat-Spec ( kommerziell! )
- gleiche Szenario Syntax als DSL, Sprache beliebig
- Java Testcode Methoden pro Test-Satz in anderer Klasse, Kopplung per Annotation
- als Junit Test ausführbar
- neue Test-Sätze sind automatisch generierbar per Eclipse Hilfe
- Ausführung des gleichen Tests mit verschiedenen Parametern per Parameter-Liste als ASCII Tabelle
- Weiteres Feature:
- Geschäftsregeln definieren,
- Datenmodell generieren,
- Oberflächen generieren
Donnerstag, 6. März 2014
Apache Cordova for android development on Ubuntu 13.10 x64 and NodeJs 0.10.26-linux-x64
- Download adt-bundle-linux-x86_64-20131030.zip and extract to
$HOME/android - Set $HOME/android/tools and $HOME/android/platform-tools to $PATH
- Install ant, if not existing: apt-get install ant
- Download NodeJs node-v0.10.26-linux-x64.tar.gz and extract to $HOME/node
- Set $HOME/node/bin to $PATH
- Install some 32bit libs for cordova:
- append to /etc/apt/sources.list: deb http://archive.ubuntu.com/ubuntu/ raring main restricted universe multiverse
- sudo apt-get update
- sudo apt-get install ia32-libs - If you want to use the android emulator
- Install another lib:
sudo apt-get install libgl1-mesa-dev
- Create a new virtual android device:
android create avd -n testandroid -t 1 - Check cordova-phonegap-3-tutorial for further steps to create a first android app with cordova
Sonntag, 1. Dezember 2013
Mittwoch, 13. November 2013
JavaScript parseInt is sometimes not enough!
after 2 hours I finally figured out, that you can not rely on a single parseInt(...), see
http://jsfiddle.net/8pPL9/9/
parseInt is used the first time during reading values from table in JS line 18
comment out JS line 27 and activate JS line 29 and you will see, that the value comparison still works with string insteadt of int values
Test-Code from jsfiddle
<div id="table_div">
<table border="1">
<tr><td>Value 1</td><td>2</td></tr>
<tr><td>Value 2</td><td>3</td></tr>
<tr><td>Value 3</td><td>10</td></tr>
</table>
</div>
var tableEl = document.getElementById("table_div").getElementsByTagName("table")[0];
var rowsEl = tableEl.getElementsByTagName("tr");
var chartDatasetData = [];
for ( var r = 0; r < rowsEl.length; r++ ){
//log("in row " + r);
var columnsEl = rowsEl[r].getElementsByTagName("td");
for ( var c = 0; c < columnsEl.length; c++ ){
//log("in col " + r);
if(c > 0){
var columnData = chartDatasetData[c-1];
if( columnData == undefined ){
chartDatasetData[c-1] = [];
}
var columnRowData = chartDatasetData[c-1][r];
if( columnRowData == undefined ){
chartDatasetData[c-1][r] = [];
}
var iValue = parseInt(columnsEl[c].innerHTML);
log("pushing value " + iValue + " to " + (c-1) + "," + r);
chartDatasetData[c-1][r].push(iValue);
}
}
}
var newData = [];
for (var j=0; j<chartDatasetData[0].length; j++){
//data has to be casted to int again!!
newData.push(parseInt(chartDatasetData[0][j]));
// this will not work
//newData.push(chartDatasetData[0][j]);
}
var upperValue2 = Number.MIN_VALUE;
var lowerValue2 = Number.MAX_VALUE;
for (var j=0; j<newData.length; j++){
log(newData[j] + ">" + upperValue2 + " = " + (newData[j] > upperValue2));
if ( newData[j] > upperValue2) {
upperValue2 = newData[j]
};
log(newData[j] + "<" + lowerValue2 + " = " + (newData[j] < lowerValue2));
if ( newData[j] < lowerValue2) {
lowerValue2 = newData[j]
};
}
log("Table-Values: min " + lowerValue2 + ", max " + upperValue2);
function log(msg){
document.getElementById("log").innerHTML = document.getElementById("log").innerHTML + msg + "<br/>";
}
Samstag, 2. November 2013
DevFest 2013 Berlin
Framework for Single Page Sites: Angular JS
- like Ant or Maven
- JS Unit Testing: Jasmine
- WebApp Integration Testing: Selenium
- google v8 engine (c++) kernel
- logstash
- kibana
measure Visits
- Google Analytics
- Comscore
Cutting Edge Web Applications
Code
JS utility lib: underscore.jsFramework for Single Page Sites: Angular JS
Build
Building WebApp with Grunt- like Ant or Maven
Test
- Quality Check on SourceCode: JSLint- JS Unit Testing: Jasmine
- WebApp Integration Testing: Selenium
Server
node.js- google v8 engine (c++) kernel
Measure
parse your logfile for errors- logstash
- kibana
measure Visits
- Google Analytics
- Comscore
Abonnieren
Posts (Atom)