Saturday, August 27, 2011

Should QA learn programming concepts?



Recently one of the QA engineers in Eurocenter started an interesting discussion on the skills required from a current day QA engineer. The discussion was opened in the linkedIn group of Eurocenter which we call "InsideOut". It is an open group and you can join from: http://alturl.com/qtron
One of the questions raised was whether the QA engineers should learn programming concepts in order to dig into the code written by developers to review the quality. Though this idea was favored by some other colleagues, my opinion was that this is not required and there are lot more valuable areas a modern QA engineer can look into, for improving the quality of a product. Following is my elaboration on this. I directly copied the following part from my comment in the group.


It is agreeable that the industry demands more from QA than doing conventional testing. Major reason behind this demand is that many quality aspects required from a software product are not covered in conventional testing which includes functional testing and traditional non-functional testing like load testing. In native world, for example, memory corruptions might not surface during normal testing. However, they can cause disasters in production environment. This puts the need for a QA engineer to have more insight into the operation of a software application than he observes in the application interface. There are two main avenues in achieving this.
                       1. Code level analysis
                       2. Operation level analysis
The former can be called white box testing and the later, black box testing. The important thing to note here is that peeping into the code or writing supplementary code is not the only way of getting more insight into an application.

Operation level analysis deals with analyzing the operation of a software in the context of a system (operating system for example) where the software is evaluated with respect to the changes it cause on the system, how it is affected by changes in the system and how it performs under various conditions in a system. The good thing about this domain is that many sophisticated tools for doing these started appearing with latest versions of operating systems. Microsoft Application Compatibility Toolkit, for example, can monitor the operation of a software and provide a detailed analysis into security problems, user access control problems, memory problems, etc. One other good example is Microsoft Application Verifier which can detect memory corruptions, memory leaks, low level operating system call failures, I/O overhead, resource allocation problems, improper locks, unsafe parallel access of data, dangerous API calls, etc. These are vital information that help in deciding the quality of software without looking at a single line of code. Being a native developer for few years I still cannot detect most problems revealed by Application verifier by examining code. There are a bunch of other useful tools of this kind that are bundled with the operating system itself. These tools are little known and are not given the attention they deserve. Even when they are used it is done by developers. However, I think QA engineers are the best people to use them to evaluate software.

Even if we think about tools like Sonar they provide a lot of metrics that manifest the quality of software without going into code level. Once we go into the code level there are hell of a lot of peculiarities like design patterns, compiler optimizations, API tweeks, hacks, etc. Since software product is more important than the code I think it will be more productive to analyze the quality of the software itself utilizing modern tools. Having said that I repeat that it's vital for a QA engineer to have knowledge to automate things using simple programming.

Tuesday, July 19, 2011

ද්විත්ව



පෙර වැකිය
ඔබ රාමුවක් තුළ ගල්ගැසුනු සොඳුරු සිතුවමක් බවට පත්විය. මගේ දෑස් නිලංකාර කරන තරමට ඔබ දීප්තිමත්ය. මම ඔබේ සිත්තරාගේ සූක්ෂම පින්සල් පහරවලට හසුනොවූ ලෝකය සොයා, රාමුවෙන් පිට නිදහස් මගෙහි යමි. හමුවන්නන්ගෙන් විමසමි. සිත්තරාද මුනගැසිනි. කිසිවෙක් නොදනිති. ඒ ලොව තවම නොදිටිමි.


* සෑම ඛේදාන්තයක්ම ප්‍රහසනයක් ලෙස පුනරාවර්තනය වෙනවා.
                            - හේගල් -


    බිහිසුනු මැදියම ඔබ සැඟවෙන විට
    වරදාගත්තෙමි එය සිහිනයකට
    සැනෙකින් නැගුනා ඔබ සිතුවමකට
    දැනගමි මා මග ඒ අබියස සිට


    නොබැඳුනි ඔහු නිමැවූ සිතුවම වෙත
    නිවරද ලෙස යමි නිදහස් මාවත
    තෙළිතුඩ නැති ඔහු දැන් මා වෙත ඇත
    එවතුදු සතුටක සේයාවක් නැත


    ඊයෙ සිහිනයයි අද ජීවිතයයි
    හුයක් නොමැති බැඳුමක පැටලී යයි
    මා සිතුවම තුළ බව ඔහු පවසයි
    හැඳිනගනිමි දැන් ඔබ මෙහි මේ යයි


පසු වැකිය
ඔබේ සැඟවයාම යනු ඛේදාන්තය නම් මගේ තීර්ථ ගමන එහි ප්‍රහසනයද?


නිර්මාන උත්තේජනය
Krzysztof Kieslowsky ගේ "The Double Life of Veronica" චිත්‍රපටය

Wednesday, July 6, 2011

ගීත විචාරයක්



කලා කෘතියක් ගැන තියෙන සාමාන්‍ය අදහස තමයි ඒකේ 'නියම' තේරුම දන්නේ කෘතියේ රචකයා කියන එක. රසිකයා උත්සාහ කරන්නේ කෘතිය පරිශීලනය කරලා රචකයා විසින් ගෙන එන්නට අදහස් කල පනිවිඩය තේරුම් ගැනීමටයි. රචකයාට වඩා දැනුවත් පුද්ගලයකු ලෙස විචාරකයා කරන්නේ රචකයාගේ පනිවිඩය තේරුම් ගැනීමට රසිකයාට උදවු කිරීම. ඒත් සමගම මේ පනිවිඩය ගෙන ඒමේදී රචකයා කොතරම් සාර්ථකද යන්න අවලෝකනය කිරීම.


හැබැයි මෑත කාලයේදී මේ ජනප්‍රිය අදහස තදින් අභියෝගයට ලක්වෙලා තියෙනවා. උදාහරනයක් විදියට ෂේක්ස්පියර් වගේ පරණ රචකයන්ගේ කෘතිවලට මනෝවිශ්ලේෂණය වැනි නූතන න්‍යායන් පාවිච්චි කරලා වෙනස්ම අර්ථකථන විචාරකයන් කරලා තියෙනවා. ෂේක්ස්පියර්ගේ කාලයේ මනෝවිශ්ලේෂණය ගැන හිතලාවත් තිබුනේ නැති නිසා මේ අලුත් අර්ථකථන ෂේක්ස්පියර් දැනගෙන හිටි දේවල් කියලා හිතන්න බැහැ. මේ අනුව වඩාත් දියුනු අලුත් අදහස තමයි රචකයා කියන්නේ කෘතියට සම්බන්ධ වන එක් පුද්ගලයකු මිස කෘතියේ අවසාන අර්ථය නිශ්චය කරන්නා නෙවෙයි කියන එක. කෘතිය අවංක නම් (ඒ කියන්නේ රචකයා විසින් තමන්ගේ මතවාද ඔප්පු කරන්න කෘතියේ සිද්ධි සහ චරිත මෙහෙයවලා නැත්නම්) කාලයෙන් කාලයට අලුත් න්‍යායන් වලට අනුව කෘතියක් අලුත්ම ලෙස අර්ථකථනය කල හැකි විය යුතුයි.

මේ අදහස මත ඉඳගෙන ලංකාවේ ජනප්‍රිය වෙලා තිබුන "වසන්තයේ මල් පොකුරු නෙලා" නමැති මහගමසේකර / අමරදේව සංයෝගයෙන් හැදුනු ගීය ගැන විචාරයක් කරන්නයි මම උත්සාහ කරන්නේ. මේ ගීතය ගැන කාලෝ ෆොන්සේකා, සරත් අමුණුගම වගේ අයගේ විචාර මම දැකලා තියෙනවා. මට මතක විදියට ඒ විචාරවල තිබුන පොදු අදහස තමයි මේ ගීය සුන්දරත්වය සහ අනිත්‍යය පිලිබිඹු කරන්නක් කියන එක. අපි ගීතයේ පළමු පේලි කීපය මුලින් අරගෙන බලමු.

        වසන්තයේ මල් පොකුරු නෙලා
        ඔබ මා දෝතට ගෙනෙන තුරා
        මග බලමින් මා සිටියා
        සොඳුරු වසන්තේ ගෙවෙන තුරා

කවියා බලා සිටින්නේ වසන්තයේ සොඳුරු මල් පොකුරු දෝතින් ගෙන ඔහු / ඇය පැමිණෙන තුරුයි. මේ සොඳුරු මල් තමා විසින්ම නෙලාගන්න කවියා උත්සාහ කරන්නේ නැහැ. ඔහු අපට කියන්නේ සුන්දරත්වය යනු අනෙකා විසින් ගෙන එන දෙයක් මිස තමා විසින්ම සාක්ෂාත් කරගත හැක්කක් නොවන බව. හැබැයි වසන්තය නිමාවන තෙක්ම ඔහු / ඇය පැමිණ නැහැ. එසේ නොපැමිණියත් කවියා කියන්නේ වසන්තය සොඳුරු බවයි. ඔහු / ඇය පැමිණෙන තෙක් බලාසිටීම හැර වෙන කිසිවක් වසන්තය පුරාවටම කවියා සිදුකර නැහැ. එහෙම නම් වසන්තය සොඳුරු වූයේ කොහොමද? සුන්දරත්වය / සතුට යනු යමක් ලැබීමද? යමක් ලැබෙන තෙක් බලා සිටීමද?

සැමුවෙල් බෙකටිගේ "ගොඩෝ එනකං" නාට්‍යයේ කථාව වන්නේ ගොඩෝ නමැති පුද්ගලයකු එනතුරු තවත් දෙදෙනෙක් බලා සිටීමයි. නාට්‍යය පුරාවටම ගොඩෝ දැන් ඒවි, දැන් ඒවි කියලා හිතෙන සිද්ධි තිබුනත් නාට්‍යය නිමවන තෙක්ම ගොඩෝ එන්නේ නැහැ. ගොඩෝ ආවොතින් සිද්ධ වෙන මහ ලොකු දේ මොකක්ද කියලා නාට්‍යයේ කියවෙන්නෙත් නැහැ. වැදගත් දේ වන්නේ ගොඩෝ එනතෙක් බලා සිටීමයි. ගොඩෝ දැන් දැන් එයි කියන ප්‍රහර්ෂයයි. අජිත් තිලකසේනගේ කෙටිකතාවක් තියෙනවා "මගේ අරමුන ඈ බේරාගැනීම" කියලා. මෙහිදී කථකයා "ඈ බේරාගැනීම" කියන අරමුන වෙනුවෙන් බොහෝ දේ කරනවා. තමන්ගේ දෑස් පවා අහිමි කරගන්නවා. "ඈ" කියන්නේ කවුද, ඇයව බේරාගන්නේ මොකටද, බේරාගන්නේ මොකකින්ද කියන දේවල් ගැන ඉඟියක්වත් ඔහු අපට සපයන්නේ නැහැ. ඒ වෙනුවට ඔහු තම අරමුන වෙනුවෙන් කරන විකාරසහගත නමුත් ආශ්වාදජනක දේවල් වලින් තමයි කථාව පිරිලා තියෙන්නේ. අවසානය තෙක්ම "ඈ බේරාගැනීමක්" සිදුවන්නේ නැහැ. අවසානයේදී කථකයා අපට කියන්නේ ඔහුට අන් කිසි දෙයක් වැදගත් නොවන බව සහ ඔහුගේ එකම අරමුන ඈ බේරාගැනීම බව.

"ගොඩෝ එනකං" නාට්‍යයේ කිසියම් ජවනිකාවකදී ගොඩෝ ඇත්තටම ආවානං වෙන්න පුළුවන් මොකද්ද? සියල්ලන් සතුටට පත්වන අවසානයක්ද? මම නම් හිතන්නේ ඒකේ අනෙක් පැත්ත සිදුවෙයි කියලා. ගොඩෝගේ පැමිණීම විසින් සිදුකරන්නේ ඔහුගේ පැමිණීම ගැන තවදුරටත් ෆැන්ටසි ගොඩනැගීමට අපට ඇති අවකාශය අවුරා දැමීම. ඊට පස්සේ අපිට සිද්ධ වෙන්නේ "ගොඩෝත් ආවා එහෙනං" කියලා ලොකු හුස්මක් හෙළලා අපේ සාමාන්‍ය වැඩ නැවත පටන් ගන්නයි. සමහරවිට මේ අවසානය "අපෝ, මෙයා එනකන්ද මෙච්චර බලං හිටියේ" වැනි ඉච්ඡා භංගත්වයක් වෙන්නත් පුලුවන්. බෙකටි නාට්‍යය පුරාවටම ගොඩෝව වේදිකාවට කැඳවන්නේ නැත්තේ මේක දන්න නිසා වෙන්න ඕන. ආශාව සම්පූර්ණයෙන් තෘප්ත වීම කියන්නේ භ්‍රාන්තියක්. මොකද එතකොට තමයි ආශාවේ හිස්බව තමුන්ටම අනාවරනය වෙන්නේ. දැන් බලමු මහගමසේකරගේ ගීතයේ මීලඟට වෙන්නේ මොකක්ද කියලා.

        අහස පොළොව ගිනියම් අව්වේ
        ගහකොළ මැළවෙන ගිම්හානේ
        අවසානේ ඔබ ආවා

කවියා මෙතෙක් කල් බලා සිටි ඔහු / ඇය කටුක ගිම්හානයකට පසු ඔහු වෙත පැමිණ තිබේ. හිස් අතින් නොව වසන්තයේ මල් පොකුරුද දෝතින් රැගෙනයි. මෙය "ගොඩෝ" ගේ පැමිණීමක්ද? ආශාව සහමුලින් ඉටුවීමක්ද? ගීතයේ මීළඟ පද දෙක මේ භ්‍රාන්තියෙන් අපව ගලවා ගන්නවා.

        ඔබ අතවූ මල් එකිනෙක පරවී
        සුලඟේ විසිරෙනු මා දුටුවා

අවසානයේ ඔහු / ඇය පැමිණියත් දෝතින් ගෙන එන සුන්දරත්වයේ මල් පොකුරු කවියා බලා සිටියදීම පරවී සුලඟේ විසිරී යනවා. ඒ කියන්නේ කවියාගේ අපේක්ෂාව ඒ අයුරින්ම සාක්ෂාත් වෙන්නේ නැහැ. සැමුවෙල් බෙකටි සහ අජිත් තිලකසේන වගේම මහගමසේකරත් ආශාව තෘප්ත වීමේ නස්පැත්තියෙන් රසිකයාව දක්ෂ ලෙස ගළවා ගන්නවා. දැන් අපට "වසන්තයේ මල් පොකුරු රැගෙන ඔහු / ඇය ආවානම් කොයි තරම් සුන්දරද" කියන අපේක්ෂාව ගිනි පෙලෙල්ලකට පිඹිනවාක් මෙන් නැවත නැවත ජ්වලනය කරමින් පවත්වාගත හැකියි.

ගීතයේ මේ වෙනකොට අපි ඉන්නේ ආශාව ඉටුවෙන්නම වගේ ගිහිල්ලා ලෝක ධර්මතාවයක් නිසා එය මගහැරුනු තැනකයි. ගීතය මෙතැනින් නිම වුනා නම් ඔබට ඇතිවන හැඟීම මොන වගේද? මටනම් ඇතිවෙන්නේ කාංසාවක්. මල් පරවීයාම යනු ලෝක ධර්මතාවයක් යන්න මට දරාගත හැකියි. දරාගත නොහැකි දෙය වන්නේ එම ධර්මතාවයෙන් පිට කිසිවක් නොපවතීය යන්නයි. සමස්තතාවාදී ධර්මයක් ලෙස අනිත්‍යය පිළිගත හැකි වුවත් එයින් වියුක්තව පවතින උත්කර්ෂවත් යමක් මට අවශ්‍යයි. මේක මට විතරක් තිබෙන ප්‍රශ්නයක් නොව සියලු මනුෂ්‍යයන්ට පොදු වූවක් බව සාහිත්‍යය කියවනකොට පැහැදිලි වෙනවා. උදාහරනයක් ලෙස අපි බෞද්ධ සාහිත්‍යය ගනිමු. බුදු දහමේ හරය අනිත්‍ය, දුක්ඛ, අනාත්ම ත්‍රිලක්ෂණය වුවත් බෞද්ධ සාහිත්‍යය තුල මේ ලෝක ධර්මතාවයට පිටින් පවතින්නක් ලෙස බුදුන් වහන්සේගේ ශරීරය සහ පෞරුෂය ඉස්මතු කරනවා. අභිධර්මයේ (මා කියවා ඇති කොටස්වල) පවා බුදුන් වහන්සේගේ පුද්ගල පෞරුෂය උත්කර්ෂයට නගා තිබෙනවා. සසරින් එතෙර වීමට උදවු වන ධර්මයද සසරින් එතෙරවූ පසු කරතියාගෙන නොයන්නැයි බුදුන් වහන්සේ පවසා තිබුනත් බෞද්ධ සාහිත්‍යය තුල ධර්මය තරම්වත් උසස් නොවන බුද්ධ ශරීරය සහ පෞරුෂය කරතබාගෙන යාමට පාඨකයා පොලඹවනවා. මගේ අදහසේ හැටියට නම් ගැඹුරු දහමක් විස්තර කිරීමේදී එයට පිටින් පවතින උත්කර්ෂවත් වස්තුවක් වරනැගීම හරිම වැදගත්. අපේ ගීතයේ අවසාන පද දෙක දැන් අපි කියවමු.

        සුලඟේ විසිරෙන ඒ මල් අතරින්
        ඔබගේ රුව මා දුටුවා

කාලෝ ෆොන්සේකාගේ විචාරයට අනුව පරවී යන මල් අතරින් පෙනෙන ඔහු / ඇය ගේ රුව පිලිබිඹු කරන්නේ රූපයෙහි ඇති අනියත ස්වභාවයයි. හැබැයි මගේ අදහස මීට සහමුලින්ම වෙනස්. මල් පරවී යාම නමැති ධර්මතාවය විසින් ඇතිකරන කාංසාව මගහැරීමට උත්කර්ෂවත් වස්තුවක් ලෙස ඔහු / ඇය ගේ රුව මතුවෙනවා. ඒක කලින් වටහාගත් දහම මගින් පාලනය නොවන, එයින් විනිර්මුක්ත වූ ශුද්ධ වස්තුවක්. මෙහිදී පරව යන මල් විසින් ගීතයට සේවයන් දෙකක් සිදුකරනු ලබනවා. එකක් නම් කවියාගේ ආශාව ඉටු නොවී පවත්වාගැනීමට ආධාර වීමයි. අනෙක තමයි ඔහු / ඇය ගේ රුව ශුද්ධවූ පැවැත්මක් ලෙස මතුකරගැනීමට (contrast) අවශ්‍ය කලු පසුබිම සකසා දීම.

ගීතයේ අවසන් කොටස් දෙකම "මා දුටුවා" ලෙස නිමවීමේත් වැදගත්කමක් තියෙනවා. කවියා අපට කියන්නේ නැහැ "මෙන්න මේක මෙහෙම වුනා" කියලා. ඒ වෙනුවට ඔහු කියන්නේ "මේක මෙහෙම වෙනවා මම දැක්කා" කියලා. ඒ කියන්නේ පරවී යන මල් සහ ඔහු / ඇය ගේ රුව පවතින්නේ කවියාගේ දැක්ම (gaze) තුලයි. දැක්ම කියන්නේ ආශාවේ එක මානයක්. මේ අනුව වසන්තය, ගිම්හානය, ගිනියම් අව්ව, මල් පොකුරු, ඔහු / ඇය යන සියල්ල කවියාගේ ආශාවේ සංඝටක ලෙස හඳුනාගත හැකියි. මේ ගීතය මම වටහාගන්නේ මිනිස් ආශාව පිළිබඳ සියුම් ඉඟි සපයන නිර්මානයක් විදියටයි. මේක මම කැමතිම සිංහල ගීත වලින් එකක්. පද රචනය නිසාම විතරක් නෙවෙයි. අමරදේව මාස්ටර්ගේ දක්ෂ තනු සහ ගායනයත් නිසා.

අවසාන වශයෙන් මෙම ලිපිය තුළ හඳුනාගත් ගීතයේ හැඟවුම් සාරාංශගත කරමු.
1. ආශාව දැල්වීම
2. ආශාව ඉටුවන්නට යනවා මෙන් දිස්වන සුරතාන්ත අවස්ථාව (භ්‍රාන්තියේ අවදානම)
3. ආශාව තෘප්තිමත් නොකොට පවත්වා ගැනීම
4. කාංසාව
5. කාංසාව මගහැරීමට උත්කර්ෂවත් වස්තුවක් පැමිණීම

පසු සටහන්:
1. භ්‍රාන්තිය (Phobia) සහ කාංසාව (Anxiety) යන වචන මෙම ලිපිය තුළ භාවිතා කර ඇත්තේ මනෝවිශ්ලේෂණයේ එම පද භාවිතා වන අරුතින් නොව සාමාන්‍ය ව්‍යවහාරයේ ඇති අර්ථයෙනි. මනෝවිශ්ලේෂණයේ එන අර්ථයෙන් එම පද භාවිතා කිරීමට තරම් මනෝවිශ්ලේෂණය පිළිබඳ දැනීමක් මට නැත.
2. ලිපියේ අදහස් සියල්ල මගේ අදහස් වන අතර භාෂා ශෛලිය (කථන භාෂාවේ සහ ලේඛන භාෂාවේ මුසුවක් ලෙස) ගොඩනගා ගැනීමට දීප්ති කුමාර ගුනරත්නගේ ලිපිවල ආභාසය ඉවහල් විය.

Speech in ICSCA 2011

I presented a paper in "2011 International Conference on Software and Computer Applications". Following is my speech along with corresponding slides.




Good Afternoon! I’m Dileepa from university of Moratuwa, Sri Lanka and I’m going to talk about a framework I developed for automated log file analysis.




First, I’ll explain the background and then the problem identification. After that, I’ll talk about the overview of the solution which is the new framework, and then the design and implementation of it. This section will include an experiment I did as a proof of concept. Finally I will conclude the work.


Software log files are analyzed for many reasons by different professionals. Testers use them to check the conformance of a software to a given functionality. For example, in a system where messages are passed between different processes, a QA engineer can perform a certain action and then check the log to see whether the correct messages are generated. The developers analyze logs mainly for troubleshooting. When something goes wrong in production sites or even when a bug is reported by an outsourced QA firm, the most useful resource available for the developer to troubleshoot is the application log file most of the time. Domain experts also use logs sometimes for troubleshooting and the system admins monitor logs to confirm that everything is working fine in the overall system level.



 Now we see that it’s always a human user who analyzes a log file in a given scenario. However, with the increasing complexity of software systems and the demands for high speed high volume operations this complete manual process has become a near impossibility. First, one needs an expert for log file analysis which inflicts a cost and even with expertise it’s a labor intensive task. More often than not log file analysis is a repetitive and a boring task resulting in human errors. It’s highly likely that when analyzing a certain log for a period of time one can identify recurring patterns. Ideally those patterns should be automated. In most cases it is essential to automate at least a part of the analysis process.



However, automation is not free of challenges. One big problem is that log files have different structures and format. To make things worse, the structure and format change over time. There’s no platform to automate log analysis in a generic way. When automating analysis, one needs to create some rules and put them in a machine readable way. Then, to manage those rules or to reuse them, they need to be kept in a human readable way too. Keeping things both machine and human readable is not an easy task. Because of these challenges, most organizations completely abandon automation and others go for proprietary implementations in general purpose languages. That inflicts a significant cost because every log analysis procedure needs to be implemented from scratch without reuse. When implemented in a general purpose language the rules are not readable particularly for non-developers. If not designed properly to deal with changes with an additional cost, it will be difficult to add new rules later and handle log file format and structure changes. Another significant problem is that proprietary automations come up with fixed reports which cannot be customized.


So there are many facts that stand for the need for a common platform for generic log file analysis. Some level of support already exists. For example, we have xml which is a universal format used everywhere. It’s a good candidate for keeping log information. Many tools are freely available to process xml. However, xml comes with a cost; the spatial cost for meta data. This makes it inappropriate for certain kinds of logs. In addition it is not very human readable. There are many languages available for processing, but they look almost like other general purpose languages. They are not for non-developer. Not every log file is in xml. There are lot of other text formats plus binary formats.

Researchers have done some work on creating formal definitions for log files. They are based on regular expressions and assume a log file consisting of line entries. Therefore these existing definitions do not help with log files with complex structures which is very common. Also they are unable to handle difficult syntax that cannot be resolved with a regular grammar even in line logs. Another flaw is that these definitions do not take any advantage from xml.


What are the expected features from a framework for generic log file analysis? First, it needs to be able to handle the different and changing log file structures and formats. It also needs to come up with a knowledge representation schema which is both human and machine readable. Also it is important to have the ability to convert to and from xml for exploiting the power of existing xml tools. Due to the reasons I mentioned earlier, the new framework must be friendly to non-developers and be capable of generating custom reports.


Ok; this is the high level picture of the solution. Mainly it comprises three modules that lie on top of the new knowledge representation schema. The input to the system is a set of log files and the output is a set of reports. The first module, which is the Interpretation module is supposed to provide a “Unified mechanism for extracting information of interest from both text and binary log files with arbitrary structure and format”. In other words it is the part of the framework that helps one to express the structure and format of his log file and point to the information of interest. Output of this module will be the extracted information expressed in the knowledge representation mechanism. The Processing module is the one that keeps the expert knowledgebase to make inferences from this information. As mentioned here it is supposed to provide an “Easy mechanism to build and maintain a rule base for inferences”. What comes out of this module is a set of conclusions drawn on the information. After that it is a matter of presenting these findings to various stakeholders. This is exactly the responsibility of the next module, the “Presentation” module. It should provide “Flexible means for generating custom reports from inferences”.


One important selection here is the way of representing knowledge. This decision must be made carefully because the rest of the solution depends heavily on that. If there is a single factor that determines the success or failure of the entire solution it should be this. After analyzing the drawbacks of existing knowledge representation schemas and the current day’s requirements I decided to use mind map as the knowledge unit in the framework. Mind mapping is a popular activity used by people to quickly organize day-to-day actions, thoughts, plans and even lecture notes. Research proves that mind maps resemble the organization of knowledge in human brain than sequential text does. Therefore it is a good form for human readability. Because of its factual form it is easy to change and visualize contents of a mind map. On the other hand, computers also can process mind maps easily because they can be represented by tree which is a popular data structure that has been there from the beginning of computer programming. All the power of existing tree algorithms can be exploited when processing them. Since xml too can be mapped to a tree, mind maps are easily convertible to and from xml which opens up the door to utilize existing xml tools in processing. In addition, mind maps can be combined with each other in node level which is a desirable feature in mixing data from different sources.


This diagram shows the architecture of the entire system. Parser, Execution Engine, Meta data and the Data types constitute the new scripting language which I will be explaining later. Text and binary file readers serve for the Interpretation module. The system exposes its functionality via a programming interface which is marked here as the Control Code. In addition to the users of the generated reports, External systems also can interact with the system to use the analyzed data.


The framework includes a new scripting language targeting the three main phases in log file analysis. It is centered on mind maps and offers many convenient operations to handle them easily. All the syntax is configurable which means one can define his own syntax to make it look like a totally new language. One main application of this can be localized syntax. Configs for syntax is kept in a separate file in a per script basis. Since mind maps can grow into very big sizes when used for analyzing huge logs it is desirable to have strong filtering capabilities to bring out a set of nodes of interest at a glance. Our new language comes with advanced filtering capabilities for this. Most of them are similar to filtering features in jQuery. One other interesting feature is the statement chaining. With this one can write a long statement like a story in one line and perform operations in many nodes with a single function call. I’ll demonstrate this in the next slide. Then the new language supports built-in and custom data types, functions like all other languages.


The scripting language is specially designed to promote a programming model which I call the “Horizontal Programming Model”. This is inspired by the pattern of referencing in natural language. In a text written in natural language, each sentence can refer something mentioned in the previous sentence, but not something said many sentences before. This neighbor referencing model results in a human friendly flow of ideas much like a story. Horizontal programming is implemented by statement chaining coupled with filtering. A complete idea is expressed in only one or two lines of code. This small snippet is independent of the rest of the script. If we consider the script as the complete rule base then a snippet can be a single inference rule. This is more favored for a non-developer because it is closer to how an idea is expressed in human language. However, the typical general purpose language programming style which I call the “Vertical Programming Model” is also supported in case someone prefers it. This model is different because it promotes distant memory calls and growth of code in vertical direction. In the example provided in the blue box, the variable “Found” is defined in the 1st line and referred only in the 10th line thereafter. This model is better for expressing advanced logic since not everything can be done using the horizontal model.



This diagram briefs the final solution with respect to the solution overview we saw earlier. We have selected mind maps as the knowledge representation schema and the three modules of the solution are going to offer these mentioned features. All the three modules are driven by the new programming language and a set of complementary tools. It’s important to note that the same unified mechanism is capable of serving for significantly different needs that arise inside these three modules.


This diagram illustrates an example use case for the system. Software applications and monitoring tools generate log files and each log file is interpreted through a script. As a result we get a mind map for each log file containing the data extracted from it. Then another script is used to aggregate these data in a meaningful way into a single mind map. We can call this the data map. Now we apply the rule base on this data map to generate inferences. This may result in an inference mind map which can then be used either by external systems for their use or by the presentation script to generate a set of reports to be used by various stakeholders. Though this is not the only way to use the framework, this scenario covers most actions that are involved in a typical log analysis procedure.




With this we can conclude that “The new framework provides a unified platform for generic log analysis. It enables users to perform different tasks in a homogeneous fashion. In addition it formulates infrastructure for a shared rule base”. The possibility of a shared rule base is important because it gives so much power to organizations and communities dealing with same tools and software to reuse expert knowledge.
 

There are few possible improvements for the framework to make it more useful in the domain. Since some software applications and tools are widely used in software development, the framework can be accompanied with a set of scripts to interpret them so that not everyone has to come up with their own version. One drawback in using the framework’s scripting language for interpreting log files is that the script does not reflect the format and structure of the log file and its mapping to the mind map. Therefore the readability is poor. A solution for this would be developing a new declarative language to map the information of interest in a log file into a mind map and generate the script from the declaration under the hood. I have already done some work on this and have submitted a paper to another conference. Apparently most expert rules are easier put in vague terms than expressing in crisp logic. Therefore it would be a good idea to add the capability to the framework to work with fuzzy rules as well. Although it’s possible in the current implementation to write a script to generate custom reports, the task will be much more intuitive if the report format can be designed in a integrated development environment with a designer. Developing such a designer is one more interesting future improvement.       



That ends the presentation and thanks for listening.

Saturday, June 25, 2011

What Women Want


This is an old and a difficult question. I guess thousands of men hit their heads on stone to find a rational answer to this. Jacques Lacan, a well known french philosopher, says the following story regarding this.

"Let's imagine a person X is sitting alone in a restaurant and a couple enters from the door. X notices the couple. Whom from the couple (man or woman) will X quickly stare at? If X is a man, of course he will stare at the woman. There's no question about it. However, if X is a woman, upon which one do you think her eyes will quickly land on? The man? Not really. She too will check out the woman. But why? Admittedly, and understandably, the woman's object of desire is the man. However, that itself does not drive her gaze. What she is really interested on is the woman whose object of desire is the same man. Who is the woman who wants this guy? Why does she want him? This is what drives a woman's gaze."

Confusing enough? However I think one cannot blame the author because of the inexplicable nature of the subject. I read this in an article written by Lacan some time back and repeated it in my words. In my experience I can say that Lacan was particularly correct here. 
Inspired by many experiences, I created the following story to express my opinion on this. It is described in the form of an experiment.

Go to a guy and offer him a pencil. He might accept it with gratitude or refuse it giving a reason. Pretty simple. Now approach a girl and offer the pencil. Most probably she will refuse it with some reason. Now you have to say this. "Fine, that other girl loves pencils. I'll give it to her then". At this point I can predict the girl's response precisely. "No, No; Don't give it to her. Give it to me."

The story might sound silly, but I suggest you (especially if you are a guy) to put it in parallel to your life experiences and check.
Although I'm not smart enough to come up with a satisfactory answer to the original question, I think this post can be ended with the following useful conclusion.

"A woman wants something only if she knows that another woman also wants it"


අසංතෘප්ත



පුපුරා යන වළාකුලෙක
උතුරා යන ගං මෝයක
දැඩිවී එන රළ පහරක
උසුලා නොහෙනා භීතිය
හැඳින්නේද නිවැරදි ලෙස


වියළී ගිය තුරුපතකට
වැහැරී ගිය දැව කඳකට
විහිඟුම් අරුතක් එක්කොට
සතුට සෙවිය හැක මිහිපිට


මල් කෙමියක රොන් අවුලක
පීදී එන ලිය ගොමුවක
නුරා පිරුනු හැන්දෑවක
සතුට තිබෙන බව කියන්න
සතුට දුටුව බව කියන්න
එපා සතුට මෙහි ගෙනෙන්න

Wednesday, June 15, 2011

Smart with a smartphone


Recently I started using an iPhone 4 as we're into the business of iPhone apps development. I really like the technology stack used for developing iPhone apps. However, I was wandering whether there is a real value of the phone in day-to-day life compared to the relatively high cost of the device. Ability to check mails any time, take a picture and shoot a video, listening to music while on the road and sparing otherwise unproductive time engaged in an interesting activity (read a book, play a game) sound interesting, but do not account for the high price. There should be lot more uses for a smartphone in the current day's life. Gradually I started downloading more and more apps and inventing ways of integrating them to my way of living which, as I think, improved my quality of life at least by a small fraction. Following are my favorite apps and how I practically use them.

1. Notes
Now I do not borrow papers to meetings, trainings, etc. "Notes" app in iPhone provides a simple interface to type important stuff and recall easily. However, I need more integration to this such as an easy search and link with my mind maps.

2. SimpleMind 
A great mind mapping app to quickly put thoughts into mind maps. Mind mapping is a very productive modern way of organizing and recording knowledge for easier recall and processing. I expect more from mind mapping apps. It will be really nice to have ability to combine mind maps and selectively show / hide content. A community mind map may be a great idea to share knowledge.

3. Mom Planner
Simple app to write tasks on start of day and mark as and when its done. Before using the iPhone I used to write down the tasks (both professional and personal) I'm supposed to complete within the day in a paper. This is a very effective way of managing daily tasks due to 2 reasons. First, it helps you to remind the tasks. Second, something written is always more effective and likely to be done than one just kept in mind. Now the smartphone provides an easier interface for this with many more capabilities than a paper.

4. Daily Deeds
This is an app targeted on people who want to develop little good habits and track the improvements. You can track what you did each day in favor of the new good habit and keep a record in a goal-oriented fashion.

5. Google maps
Very useful to find places when driving. One flaw is that the places in Sri Lanka are not properly geo-coded yet, so you cannot enter an address and find the geographic location correctly. However, it is still useful for finding roads.

6. Eurocenter maps
This is a map application we developed for offline maps. Great when there is no internet connection. In addition it has the capability to record paths you traversed. I tend to forget places I visit just once, so this is really smart functionality.

7. Flash light 
Usage is obvious.

8. Calorie counter
Useful to find the approximate calorie count in restaurant food. This might be more useful in a country with a better food culture where you get exactly what you ordered in a restaurant. However, it is still useful in Sri Lanka too, to get a rough idea about the caloric load of food before ordering in a good restaurant.

9. Dictionary
I use a normal dictionary app called "English" and a wordnet dictionary app named "Wordweb". Both are highly useful. The wordnet dictionary helps to view the semantic relationships between words in the form of a taxonomy.

10. RunKeeper
This is an app to record the duration, length and calorie consumption in jogging sessions. It uses GPS to record the path and provides a simple interface to save the data both locally and into the web. Most interesting part is that it is done as a social networking activity so that I get connected with the other guys living in geographically closer locations who use the same app. You see the progression of each other's activities. This is a great way to motivate yourself to go for a workout.

11. Knots
A quick guide for tying various knots.

Although there are hundreds of thousands of apps available, only a very small fraction of them is useful for a particular person's life obviously. It highly depends on his or her interests and the way of living. I'm eager to know how others use smartphones productively in their lives. Currently I use only utility apps, but the business apps can add a lot too. Apparently smartphones together with social networking will revolutionize the people's lives. It is logical to expect to see more and more people using smartphones as an essential tool in their daily lives. The prices should go down and the data connections have to be more ubiquitous. Meanwhile, I will try do my homework to be ready for that new shift.