Wednesday, April 27, 2016

Protractor within the code development process (especially testing)

Short intro: Protractor is a tool to simulate user actions on a web page allowing page testing. It is a good option for pages using angular.JS. Since recently many services are moved to web pages - it is gaining on popularity.
In bellow I'll try to introduce some topics easily for a newbie to understand and then describe my experience with the tools.

Let start with the test object. It is usually a web page with:
  • front-end written in html + javascript + css
  • javascript framework like angular.JS or backbone.JS or ... - if you have angular.JS then protractor is probably good for you
  • front-end's back-end - usually static content mixed with semi-dynamic or dynamic content... might be simple HTML, JAVA or something similar... unfortunately might be php, perl, shell, powershell or any other crap
  • backend - usually JAVA or similar running within the application server (application container or whatever you call it) - often Oracle's Weblogic (former BEA), IBM WebSphere (quite expensive and sux a bit), TomCat, JBoss or other
  • database - often Oracle database or something like Apache Cassandra, MySQL or MariaDB, PostGreSQL, MongoDB, ...
And the goal for protractor lies in (the items in bold):
  • Unit tests - usually written by the developers
  • Integration tests - often written (partially) by the developers
  • API Tests - sometimes written by the developers, often not in place and combined with integration tests
  • Smoke tests - quick tests executed just to see if the development code is working someway - might be executed manually but should be (semi)automatic
  • Automatic test suite - tests executed on a dedicated environment, triggered by "having new source" - usually executed automatically as a part of continuous integration
    • automated code quality check (static analysis)
    • code acceptance
    • code building
    • code deployment (onto test environment)
    • automated tests execution
    • tests report
    • measures and metrics
    • tests verdict (go or no-go)
  • Nightly tests - executed from time to time (schedule based or whenever there are resources available, rarely event based) - full set of tests that runs over several hours (or even days)
  • Acceptance tests (good if you are starting with good feature definition and well designed code as acceptance might be partially automated) - usually focused on the front-end only
I'll try to fill the list with more layers of the development process as the list is not complete.

Reason to move everything onto web pages is simple. Internet is accessible all the time and (almost) everywhere. It is difficult to run an app on the device only (it requires installation, platform compatibility, version checking, storage handling and many more things to handle). Your browser can handle much of that so costs can be reduced. Code is installed only on the server, it is always the latest version, platform is known (well... browsers are the new version of platforms here and their compatibility is not full).


Since the complexity of such applications is very high - we need tools to verify those. During the tests you should usually focus on a single element to verify. This applies to user interface testing as well. We have the following layers used in user interface tests:
  • User interface you interact with
    • This is the web page and server that it runs on
  • Definition of the operations you want to perform on the interface
    • This defines data to be entered
    • and steps to perform
    • and verification of the actions that happen afterwards
  • Mocks!
    • Instead of having all the layers of your application you should have a stub that emulated those layers
    • You must have a clear definition of layers inter-communication
    • You must focus on a single layer only (and its closest neighbors)
Web page is often tested within an actual web browser.
We simulate user actions using browser's built-in interface to do such.
Communication with this interface is usually handled by "selenium".
Selenium does what it is said by the next layer which might be, for example, the protractor with tests written in a language called jasmine.

More information to be added later :)

Tuesday, April 12, 2016

Scrum points and tine - question often asked

It is a very common question to be asked: Why estimate in scrum is given in scrum points instead of time/money.

This answer is my personal opinion and many might disagree with some of the points - feel free to comment bellow.

In short - it is by purpose to disconnect fixed money, fixed content, fixed time, fixed work-hours, high expectations, uncertain estimate and unpredictable future. Without it estimation would be used as fixed price and no one would take the risk into account.

Thursday, March 24, 2016

Lenovo MIIX 3-1030 and clean reinstall of Windows 10

Since we can upgrade windows 8.1 to Windows 10 for free (but there might be some catch in it) and Lenovo MIIX 3-1030 comes with Windows 8.1... then why not?
After upgrading it I tried to do a clean install. There is an issue though - the clean install is not that simple as it might seem.
First of all I suggest to make a picture of the "windows information" and its serial number. Just in case.

Windows authentication
Microsoft didn't provided serial numbers of Windows 10 to consumers... yet. Device authentication is based on some magic. Probably the serial number of your processor or motherboard.
Conclusion: No serial number is needed.
By the way - you will be probably restricted in the number of activations allowed - so don't reinstall the system too frequently or use an already-authenticated backup for that.

Media for clean install
You need to download media creation tool from Microsoft. Then choose option to install on another PC. I recommend creation of USB media. Preferably two of such just in case.
And you can use 32-bit version of windows as the device has only 2GB of RAM and there would be little benefit for you from 64-bits (as an assembler-experienced developer I can say that there is a benefit but it is barely used). I am not even sure whether it would authenticate with 64-but version.
You might also wish to decrypt your drive if it I encrypted with microsoft's encryption bitlocker (which is already cracked anyway and NSA knows how to bypass that).

Connecting your bootable media
You need to connect the USB pen-drive (or card reader or whatever media) to your computer. For me putting memory card into memory slot was not enough - BIOS was not seeing this during booting process. But it worked fine to put the pendrive into keyboard's USB port.

Booting up
You need to enter the "bios" settings. This is a touch-screen thing and you need to power-off your device, then power it on keeping "volume up" pressed (probably volume down would work too, I haven't tested).
Ensure that you have secure boot disabled... we don't need this crap.
Remember to keep your device plugged-in a it might drain your battery during installation.
I have chosen correct boot source (the second option) and it worked well. Still it would be nice if booting from SD worked - but it is not.

Installation
Tricky part. Touch screen is not working by default (at least for me) so I had to use the keyboard and touch-click plate. But I have connected a mouse - as there are 2 USB ports available on our keyboard.
Installation for me included option "advanced", then format of the large drive (which was 28GB in my case)... then waiting for a long time.

Configuration
After restart we are asked for the user account. You don't need Microsoft account - but the button is well hidden (seems as normal text with tiny font on the bottom... it is gray-or-blue on gray background).
I suggest disabling all the options for data sharing with Microsoft. At first I had nothing against... until I realized what amount of data they receive and how they are using the access to control my computer more than I can.

Drivers
After bootup windows wouldn't have touch-screen working, nor the battery icon shown. Screen would work at maximum brightness only.
The trick is to intall intel's driver 4rm101af.exe
It does handle all the things.
I have first installed the acpidriver.exe and it wasn't enough to see the battery status. After intel driver was installed I had:
- touch screen working
- display brightness working
- battery interface (and battery icon) working

Next steps are to update everything and go through all the configuration you need.
And we end with a cleanly installed windows 10 without Lenovo's bloatware.

Known issues (section added on 2016-04-16):
The memory card is un-mounting after waking up from sleep.
This is an issue within the Windows itself. Memory card itself is still mounted and visible within the system but the volume (let's say "the drive letter") is not there. Solution is to disconnect and reconnect the card. I believe that it has something to do with timing as for some users on the internet it worked to change the card, clean it up or do similar magic.

Good luck and let me know if it worked for you.

Monday, March 14, 2016

Witcher 3 (any game) stuck at 24/28/30 fps...

So I wanted to play the Witcher 3 - great slavic (Polish) game. Tried 4k resolution but it gave me only 25 fps. Unfortunately it is due to my poor system's performance.
After lowering the resolution to 1080... I got 30 fps (+/- 1fps). The reading was too precise and it wasn't what I expected after 25fps@4k.
Reason is that my display works on 30fps.
Solution: go to windows display settings, go to the advanced options, choose monitor display modes and choose the one that has 60Hz. Restart the game. Make sure that you have fps limit set to 60 or "unlimited" in the options.
Also remember that 1920x1080 resolution with the best antialiasing is worse than 4k (3840x2160 that is 4x1920x1080). And nVidia sux. With nVidia 60fps is better than 30fps. And drivers tend to hang. And nVidia sux.
If I helped you - please, leave a comment bellow :)

Niepotrzebne rzeczy dla dziecka/chłopca

Moja latorośl (syn - co jest znaczące) ma już 8.5 roku. Ostatnio zabrałem się za porządki u niego w pokoju i postanowiłem spisać jakich rzeczy mamy zbyt wiele. Inaczej mówiąc: na jakie rzeczy mamy nadmiar i ktoś wyrzucił niepotrzebnie pieniądze na zbędne wydatki i niewłaściwe prezenty. Oto one:
  • puzzle
Na początek fajne. Synek świetnie sobie radził z układaniem puzzli do 100 elementów. Później  jednak zapał mu osłabł - a kupowanie kolejnych "bo kiedyś tak ślicznie układał" to... powstrzymam się od komentarza.
  • gry typu memory - wystarczy jeden zestaw
Jedna z fajniejszych rzeczy dla dziecka. Super się w to gra rodzic-dziecko. Można też włączyć do gry obrazki bardziej skomplikowane jak np. flagi. To może niesamowicie uczyć i wyrobić pamięć dziecka. A także zręczność - małe dziecko zazwyczaj karty przesuwa i rozrzuca... odpowiednio pracując z dzieckiem wyćwiczymy też zręczność. Problem się pojawia jeśli dziecko ma już kolejny zestaw na półce a używa i tak tylko jednego. Jeśli dziecko wygrywa z rodzicami w grze na 64+ pary to można przeskoczyć na inne zabawy.
  • książeczki
W dzisiejszych czasach książki odchodzą do lamusa. Dzieci czytają książki bo muszą. A takie małe z kartonu, często niewymiarowe z jakimiś maskotkami i udziwnieniami utrudniającymi postawienie ich gdziekolwiek - to jest najgorsza rzecz, którą się prędzej czy później wywala.
Masz odrębne zdanie? Masz do tego prawo. Ale nie kupuj z tego powodu rodzicom dziecka śmieci tylko dlatego, że uważasz, że to coś bardzo wartościowego i papier jest lepszy od dziecka a dziecko należy posadzić przy książce żeby czytało.
Nasz syn super radzi sobie z czytaniem. Na co dzień jednak wygrywają wynalazki takie jak gry komputerowe, filmy (ach ta TV... najlepiej by było gdyby już dziś zniknęła), zabawy na dworze (jeśli jest pogoda), robienie czegoś z rodzicami.
Jak już to do czytania polecam serię "franklin" o przygodach żółwia. Wolał bym aby opisywały przygody chłopca ale nawet o żółwiu niosą sporą wartość dla dziecka.
  • lego (ale trochę trzeba mieć)
Bardzo edukująca zabawka. Niestety przegrywa z grą minecraft pod względem kształtowania wyobraźni.
Trochę lego potrzeba ale powyżej skrzyni to już przesada.
Polecam gry z serii LEGO - ale tylko na kontroler i z rodzicem.
  • pluszaki - jeśli jest ich więcej niż pare
Jeden ukochany miś czy lala to super sprawa. Sto pluszaków to przesada.
  • słodycze
Zawsze mnie zastanawiało dlaczego kolega przynosi do pracy dla kolegów słodycze. Chodziło o prezenty. Jego 3 córki dostawały z byle okazji słodycze i je odkładały. Ile można żreć węglowodany? Dzieci rzygają już słodyczami albo dostają cukrzycy.
  • karty do "gry" z firmy panini
Dziecko się z tego cieszy. I kolekcjonuje. Ogląda. Czyta.
Problem w tym, że idzie na to kupa kasy a koniec końców kilkaset (tysięcy?) kart trafia do śmietnika lub na allegro.

Co więc kupować?
Polecam unikać nadmiaru czegokolwiek. I unikać kupowania czegoś tylko dla prezentu.
Sam lubię karty podarunkowe - szczególnie do sklepów typu decathlon.

Friday, March 4, 2016

30 Mbps czy 30 MBps ?

Postanowiłem dzisiaj ściągnąć cinematic mod do HL2. Waży to sporo. Problem tylko jak to ściągnąć. Jedyna fajna opcja to torrent. I klient torrent jakiś jest potrzebny. Z lenistwa użyłem czegoś tam pod Windowsa czyli bez zabezpieczeń. Leap vuze. No i interfejs jest prosty ale jednostki to nie wiadomo czy bity czy bajty.
Po odpaleniu okazało się że jednostki poprawne: duże MB=mega bajty. 30MB/s czyli Orange daje rade (mam 300 Mbps ale jest chyba 15% extra pewnie na nagłówki pakietów czy coś w tym rodzaju).
CM2013 ściągnął się w 13 minut (18GB). Wiec nieźle.
Wniosek: żyję w kraju 1 świata :)

W ramach uzupełnienia:
30 Mbps to
30 mega bit per second czyli
30 milionów bitów na sekundę czyli
30 Mb/s czyli
30 mega (1/8 z bajta) na sekundę czyli
3.75 mega bajta na sekundę czyli
3.75 MBps czyli
3.75 MB/s

Czasem można spotkać jednostkę MiB co oznacza
mega-binary bajtów, czyli
1024*1024 bajtów czyli
1 048 576 bajtów czyli
nieco więcej niż MB który oznacza tylko milion bajtów

Producenci i usługodawcy często celowo mieszają te jednostki.
Programiści (choć to się może wydawać dziwne) często nieświadomie mylą te jednostki.
I tak:
mb to niepoprawna jednostka - milli bit czyli ułamek bita (taka jednostka nie istnieje)
KB to również niepoprawna jednostka - literka "k" musi być małą aby oznaczało to skrót "kilo" czyli tysiąc

Poprawne jednostki:
b (bit czyli 1/8 bajta), B (bajt), kB (1000 bajtów), kiB (1024 bajty), MB (1000000 bajtów), MiB (1048576 bajtów czasem oznaczana myląco jako MB), GB (1 000 000 000 bajtów lub myląco 1024 mega-binary bajty), GiB (to zawsze 1024*1024*1024 bajty), TB (1024 GB lub myląco 1024 GiB). Dalsze jednostki to peta bajty i inne... tych przedrostków jest wiele.

Wednesday, March 2, 2016

TV Gawex w Fordonie

Jestem abonentem "TV Gawex". A dokładniej płatnikiem - ponieważ TV nie oglądam. Dotychczas była to jednak jedyna rozsądna opcja internetu (poza neostradą/netią).
Ale dziś postanowiłem to zmienić. I po dzisiejszym dniu muszę pochwalić TV Gawex za jakość obsługi klienta.
TV Gawex (www.tvgawex.pl) to osiedlowa kablówka, która się rozrosła i zaczęła w którymś momencie oferować (drogie) usługi dostępu do internetu... i inne tego rodzaju. Zasięgiem obejmowała na początku chyba tylko Bydgoszcz/Fordon ale z czasem weszli też gdzie indziej (m.in. Chełmno).
Klientów mają dzięki wyłączności - ludzie muszą wybierać spośród ograniczonej puli opcji. Kablówka to albo analog, albo talerz na balkonie... albo gawex, który już jest. Internet często też ograniczony - spółdzielnia oraz wspólnoty nie chciały podpisywać umów z np. UPC.

Ceny. Są drakońskie - ale poprawiły się mocno. Teraz można mieć 2Mbps za 30zł/miesiąc, 15 (lub 50) Mbps za 60zł/miesiąc. To drogo - ale alternatywą często jest utrzymanie łącza tepsy oraz internet po tymże łączu. Czyli <20mbps -="" 100z="" ale="" c.="" cenowym="" co="" duopak="" fajna="" gorszym="" i="" internet="" jak="" jest="" konkurencja="" lubi="" ma.="" ma="" miesi="" na="" ni="" nie="" nieco="" no="" opcja="" p="" poziomie="" si="" telewizja="" to="" za="">
Umowa jest fajniejsza niż u konkurencji. Zacznę od okresu wypowiedzenia: 1 miesiąc. Instalacja nawet nie wiem - darmo albo jakoś tanio. Płaciłem chyba z przyzwyczajenia 41zł/miesiąc za sygnał TV (nawet nie odbierając go w związku z brakiem odbiornika rtv) i przez jakiś czas miałem internet 15Mbps. Okazało się, że internet lagował i gubił czasem pakiety... i jakoś mniej sprawnie działał niż np. netia po łączach tepsy. Internet odpuściłem.
Z odłączeniem internetu nie było problemu - wypowiedzenie (więc płaciłem tylko za 1 miesiąc) bez problemu przyjęte (na miejscu wydrukowali - wystarczy przyjść z dokumentem tożsamości lub upoważnieniem). Trzeba było zwrócić jeszcze modem.
Odłączanie sygnału TV tak samo łatwe - dostałem od razu wydrukowany kwitek do podpisania z kwotą którą należy jeszcze uiścić (umowa trwa do końca miesiąca jeszcze) i jest to jednocześnie potwierdzenie rozwiązania umowy. Kwitek zajmuje kawałek strony - na jednej kartce wydrukowali 2 kopie. Ekologicznie i praktycznie - kocham takie podejście.
W biurze obsługi klienta tylko jeden człowiek przyjmował. Ale to wystarczyło - obsługa expresowa. Godziny otwarcia tylko średnie - 9 do 17 w dni robocze.

Mam teraz internet od orange - ale na siebie. A czasem potrzebuję do pracy łącza. Myślałem o alternatywie przez łącza netii - a właśnie z tych korzysta gawex. Więc rozważam wzięcie drugiego "rezerwowego" internetu jak by orange dupy dało. Ale drugi na firmę już i za te 30zł/miesiąc (czyli de facto 240zł/rok netto).

Moje dotychczasowe doświadczenia z dostawcami internetu (i TV bo to ostatnio w parze idzie) są następujące:
- netia ledwo akceptowalna - problemy przy odejściu... internet raczej działa bez problemów (jak są problemy to bardzo niefajnie z rozwiązaniem)
- tepsa jak netia - oba psy (netia i orange) takie same z jednego miotu
- UPC fajne warunki daje dla nowych klientów ale rżnie w kakao obecnych klientów - odstąpienie od umowy spoko... jakość usług OK i raczej zawsze działa
- Multimedia to porażka - wysokie opłąty, zawiła umowa, okres wypowiedzenia 3 miesiące lub więcej (można od razu odstąpić bo to "na czas nieokreślony" ale chcą 3 miesiące kasę dostawać)... jakość usług strasznie zawodna, syf, kiła i mogiła - odradzam

Tak więc koniec końców chciał bym bardzo pochwalić TV Gawex za podejście do klienta i nie-utrudnianie odejścia (być może dzięki temu podejściu wrócę do gawexu kiedyś na internet). Jednocześnie dotychczas mieli tam niezły burdel i słyszałem, że potrafili się po kilku latach odezwać o nieopłaconą fakturę czy coś podobnego... Dziś wygląda to już sprawniej.