Categories
Low-Code MachineLearning Products

Test-Automatisierung mit KI

Anbei ein Beispiel aus meiner Praxis wie man Agenten und Automatisierungswerkzeuge benutzen kann um wiederkehrende Aufgaben ohne manuellen Aufwand zu erledigen.

KI-Werkzeuge ersetzen in der Testautomatisierung keine Testerinnen und Tester. Richtig eingesetzt nehmen sie aber viel Routinearbeit ab. Zwei Projekte aus meinem Alltag zeigen, wie das aussehen kann.

Beispiel 1: „AI first“: Tests direkt aus User Stories

Bei einem großen IT-Dienstleister im öffentlichen Umfeld haben wir die Testerstellung umgedreht. Früher kam zuerst die Story, dann die Entwicklung und ganz am Ende der Test. Jetzt steht die KI am Anfang.

Sobald eine User Story mit ihren Akzeptanzkriterien fertig ist, erzeugt ein KI-Agent daraus einen ersten Satz Testfälle: Positivfälle, Grenzwerte, Fehlerfälle und Hinweise auf Lücken in der Story selbst. Wir als Testteam prüfen, schärfen und priorisieren diese Vorschläge. Anschließend werden sie in automatisierte Tests überführt.

Das bringt vor allem drei Dinge:

  • Frühere Fehlerfindung: Unklare oder widersprüchliche Akzeptanzkriterien fallen schon beim Generieren auf, nicht erst im Test.
  • Schnellerer Start: Niemand beginnt mehr mit einem leeren Blatt. Die Grundabdeckung steht deutlich schneller als bei rein manueller Erstellung.
  • Mehr Zeit fürs Wesentliche: Wir konzentrieren uns auf explorative Tests und fachlich knifflige Fälle.

Wichtig ist dabei: Die KI liefert Vorschläge, die fachliche Verantwortung bleibt beim Menschen.

Beispiel 2: Desktop-Client-Automatisierung mit FlaUI und Inspektor

Ganz anders lag der Fall bei einem Softwarehersteller mit einem klassischen Windows-Desktop-Client. Webtests sind gut erforscht, Desktop-Anwendungen werden in der Automatisierung oft vernachlässigt.

Wir setzen hier auf FlaUI, eine .NET-Bibliothek, die über Microsoft UI Automation auf die Oberflächenelemente einer Windows-Anwendung zugreift. Der Ablauf:

  1. Mit dem Inspektor (FlaUInspect) wird die Elementstruktur des Clients ausgelesen: Fenster, Buttons, Eingabefelder und ihre AutomationIds.
  2. Diese Struktur dient der KI zusammen mit dem gewünschten Testablauf als Grundlage.
  3. Die KI erzeugt daraus lauffähigen Testcode, inklusive Element-Locators und Prüfungen.
  4. Wir reviewen den Code, ergänzen stabile Wartestrategien und binden ihn in die Testsuite ein.

So entstehen Desktop-Tests deutlich schneller als von Hand. Gleichzeitig zeigt der Inspektor sofort, wo der Client nicht gut testbar ist, zum Beispiel bei fehlenden AutomationIds. Diese Rückmeldung geht direkt an die Entwicklung und verbessert die Testbarkeit dauerhaft.

Fazit

Beide Beispiele zeigen dasselbe Muster: Die KI übernimmt das Erzeugen, der Mensch das Bewerten. Ob Testfälle aus User Stories oder Testcode für eine Desktop-Anwendung, der größte Gewinn liegt nicht nur in der Geschwindigkeit. Fragen zur Qualität kommen deutlich früher auf den Tisch.

Categories
Common

Install bin from USB to Cisco Catalyst C9300

Assuming the switch needs to be wiped.

Step 1: Boot the switch and interrupt the boot sequence (Press the Buttons on the Front while booting)

Step 2: Inster USB Stick on the Front with matching Cisco Image (in .bin-Format). Check if you can see the file enter: “ls usbflash0: “

Step 3: Enter “emergency-install usbflash0:your-image.SPA.bin”

Step 4: Good Luck !

I have capture the process with OBS here, took a few minutes

Categories
Common

App portals

A lot of my latest work involved creating app store / portals which present available applications to (internal) customers (see example below). Usually the design is based on a dashboard with the apps as cards or tiles, similar to lotus notes or windows. When creating your own framework you can embedd the portal in your environment and business processes and e.g. reuse existing iam mechanisms or track usage.

However if you can stick with a restricted standard you can also use commercial available software – or even open source. One example is backstage (from Spotify). Main idea is to have a service or software catalog. You can customize the cards in this solution to match your desired design by adding themes when creating elements (example from the demo):

If you need a similar solution (completely programmed and flexible or based on backstage.io with customization) you can contact me.

Categories
Common Home-Server

Inplace update of Linux Mint to 22 / Wilma

Update triggered with the tool mintupgrade “sudo mintupgrade check”, if not present “apt install mintupgrade”

Was a bit scared when the Fonts were upgraded and the app names got crypted, but that was fixed during the update. You need to have a system snapshot with timeshift in order to perform the update. Update was performed on an AMD System 5950x with a RTX 3080 with encrypted disk. Took half an hour, but thats fine.

I think there will be an official guide in the next few days, but for me was smooth enough without the exception that my cable network needed to be added manually after the upgrade and howdy does not work anymore.

Categories
Home-Server MachineLearning

Using AI in programming (selfhost) Part 3

To make it short: I’m now using an existing opensource tool for VSCode which can point to my local server. It’s called open copilot and is licensed under Apache 2 which allows commercial use.

Once setting up the url for your local server you can query the extension “cody” with the icon on the left sidebar or within inline code.

Its somewhat usable on my machine.

Categories
Common

Using AI in programming (selfhost) Part 2

Here i will describe how to install the code llama modell on one of your VM’s. Problem here is that you usually loose the GPU support because MS is still not able to provide GPU-P for Hyper-V. TY MS at this point.

First prepare a vm, I’m choosing ubuntu srv 22.04.03 LTS. Assigning 8 cores and 64GB of RAM.

Check if git is installed (insert “git –version” in the terminal):

Clone the llama.cpp project, insert the following commands in the terminal (“make” w/o anything is cpu only, you may need to install the gcc compiler):

git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
sudo apt install build-essential //gcc compiler
make

Downloading the model can be done with a nice script:

bash <(curl -sSL https://g.bodaay.io/hfd) -m TheBloke/CodeLlama-70B-hf-GGUF --concurrent 8 --storage models/

After downloading the modell, we can start llama.cpp.

./server \
    --model ./models/TheBloke_CodeLlama-70B-hf-GGUF/codellama-70b-hf.Q5_K_M.gguf --host 192.168.50.13 --port 8080 -c 2048

Next step would be to create a plugin for VS e.g. to autofill code from commentblock.

Categories
Common

Using AI in programming (selfhost)

This is a an example on how to use AI in your own environment. I’m using the popular LLM Code Llama from Meta which is open source (also for commercial use) and supports C#, my main programming language. Another advantage is that you can use it in your own environment and your most value asset the sourcecode will not leave your network.

Code Llama comes in different sizes, I’m currently using the 70B Model which returns the best result but requires quite a bit of resources. I’m showing you how to self host a tool which runs the llm locally on a central server and write a simple VSCode extension to access the api to query results.

But first lets try to run it locally on my development machine. For this just install ollama (MIT License) and select the model from meta.

It usually gives you a code snipped and an explanation. It works, but it may be a bit inconvenient. In the next post, I’ll show you how to run the modell on your own virtual environment and access it via web or inside your code editor.

Categories
Common

Failed to start gitea on Fedora 38 after update

Maybe this helps other user. Just updated gitea and service refused to start: Process: 48241 ExecStart=/usr/local/bin/gitea web -c /etc/gitea/app.ini (code=exited, status=203/EXEC)

In the log (journalctl -b 0 -u gitea) there are permission issues: gitea.service: Failed at step EXEC spawning /usr/local/bin/gitea: Permission denied

I checked permissions and they are ok. Found out that selinux flagged that file as user_home_t as it was downloaded to that location.

Fixed the issue with command (sudo restorecon -rv /usr/local/bin/gitea) to remove the user_home flag.

Categories
Common

Automatisierung des Postident Portals

Aus einem Kundenprojekt kam die Anfrage den Identifizierungsprozess z.b. mittels Personalausweis und Videoident einfach über einen internen Prozess starten zu können und die Ergebnisdaten nach Abschluss des Falles entsprechend zu verarbeiten. Das Projekt wurde in C#/Asp.Net umgesetzt und läuft auf einem internen Webserver. Die Ergebnisdaten werden per Cronjob einmal am Tag abgerufen und bei Änderungen im Status entsprechend behandelt, zumeist archiviert.

Der Code stellt nur Ausschnitte des Projektes dar, wer Interesse an einer konkreten Implementierung hat kann sich gerne an mich wenden.

Prepare a call to create a new case:

Perform api call and process result with caseId:

Categories
Common

SSD upgrade on a Samsung Galaxy Flex 2 5G (not possible)

Seems that the Notebook uses not a standard 2280 m.2 SSD but instead a much smaller one (maybe 2230). I just wanted to install a Samsung 980 Pro on my exemplar but aborted the operation.

The SSD is above the Battery in the middle.

The SSD is under the Metal Frame in the Middle above the Battery.

Btw.: Disassembly is pretty easy: Just remove 4 screws and use a suction cup on the front corner on the bottom (not on back side at hinge area which seems to be much stronger).