Tuesday, November 1, 2016

דיון מתורבת באינטרנט?

Having a meaningful online discussion

Last Tuesday, I joined (again!) Tuesday Night Testing for an hour of talking about testing, which was great.
One of the subjects discussed was raised by Andrew Fraser who shared a recent experience he had after posting this blog post and receiving some rather violent comments (I'm assuming they were deleted, or are somewhere in the twitterverse) and wondered whether the testing community is a harsh place,and the discussion went rather quickly to whether it's ok, or what causes this phenomenon. Personally, I was quite happy that I didn't want to register to yet another platform, and that Medium does not allow for non-registered comments, since my initial reaction to that post was "where's my pitchfork?" (Alternatively, there's Randall Munroe's way of saying the same thing).
And the thing is - my personal experience is quite the opposite - blogs that I read are usually a rather pleasant place to have a discussion in (I refer to blogs I read, since this blog has yet to host a disagreement or a lengthy discussion), and I rarely see any harsh comments (that are not quotes from Twitter), Usually, what I see is comments that are to the point and do a fair amount of effort to avoid insulting. The same is true to other online discussions I participate in (such as a forum or facebook, which I try to avoid from other reasons) - Sure, there are the occasional petty quarrels and snappy comments - but they are normally met with a firm response from the other participants.
Somewhere during the discussion (perhaps even at the very start of it), Andrew said something along the lines of "The post was purposely agitating, so I guess I got what I aimed for" (the original statement was much better worded, but the general idea was that the post is written to make people react, and they did so emotionally) - and it seems to me that this short sentence is nailing it all - you get what you give - if you are using a language that agitates your audience, some of them will react in a strong tone, and will feel they can be more liberal about their choice of words. If, however, your tone is more to the point, and you take care to choose your words carefully, people usually react in kind.
So, what can I do to make my blog more inviting and less about mud-throwing? I still want to have discussions, and I love debates where I can disagree with someone, and by the end of the it we still don't agree but learned something new while trying to convince each other.
My honest answer is - I don't know. I can, however, make some guesses that match my experience - as reader, commenter, and occasional blogger.

One of the first things to do is to make sure that I choose a title is either matching exactly the content of what I write about in the post, or one that will not invite people to respond only to the title. If the title can be Tweetted, or if it's infuriating by nature (or even just annoying), people will probably react to it, disregarding the text I worked so hard on writing. Andrew's post, for instance, has a really good point - testers should not assume that they know better, and fighting for every bug to get fixed is more than just annoying, it is sometimes harmful to the business and is actually bad testing. However, he calls this behavior "bug advocacy", and states "Death to bug advocacy" - As a reader, this title sets my entire perspective of the post. I like the idea of bug advocacy, so I read and try to see what exactly is wrong, in Andrew's eyes, in it. Going through the post, I can see that Andrew is using this term to describe something else. Or rather - I see that he's attributing wrong properties to bug advocacy. In other words (and please, don't take this as my actual opinion, I'm trying to put words to an initial emotional reaction) - "this good-for-nothing person I have never met is saying stupid stuff because he doesn't understand a thing". When I read this post and react to it, I am reacting to a "death to..." statement. If, however, the title had less outgoing (say, something along the lines of "bug advocacy, is it actually a bad thing?"), my whole approach would be less aggressive and more inquisitive.

A second thing to take care of is to explain the terms I use - I won't always do that, but especially when I'm going against something, I will try to explain how I define it - just to make sure people know what am I referring to. Having a shallow agreement on terms can sometimes lead to wasteful debates where each side simply can't understand the other side's arguments.

And a last point, just to get to three - I believe that sharing experiences is less prone to violent comments, probably because my experience is mine, and mine only, but also because by sharing an experience I am delivering much more than the bottom line - I'm walking the reader through my thought process. I could simply write "Gui-based 'test tools' are inferior to actually programming", but by talking a bit about my experience with Human Resource Machine", I believe I can get the reader think a bit before going out all "I use ReadyAPI! and have a great automation suite!!! you have no idea what you are talking about!" (by the way, if this doesn't work, do tell me).

There are probably a million other things to watch out for when trying to write something that will invite a civilized discussion instead of a flame-war, but taking three of them seems to me like a good start.
----------------------------------------------------------


ביום שלישי האחרון השתתפתי (שוב!) במפגש "בדיקות בשלישי בלילה" וביליתי שעה בשיחה עם עוד חמישה בודקי תוכנה שהיו להם דברים מעניינים לומר, והיה אחלה. 
אחד הנושאים עליהם דיברנו הועלה ע"י אנדרו פרייזר שחלק איתנו את החוויה שעבר אחרי שפרסם את הפוסט הזה. מה שקרה, בקצרה, הוא שהוא קיבל כמה תגובות לא נעימות במיוחד (אני מניח שהן נמחקו, או שהן פורסמו מלכתחילה בצייצן) והוא העלה את התהיה - האם קהילת הבדיקות היא קהילה נוקשה? הדיון התקדם די במהירות לדיון על גורמים אפשריים לנוקשות הזו, ומה אפשר לעשות כדי לצמצם אותה. באופן אישי, די שמחתי שכדי להגיב ב"מדיום" צריך להירשם ולא היה לי כוח ליצור עוד חשבון רק כדי להגיב, כי התגובה הראשונה שלי אחרי שקראתי את הפוסט הייתה "איפה השארתי את הקלשון שלי?" (לחילופין, לרנדל מונרו יש ניסוח טוב יותר). אבל, הנקודה שאני רוצה להתעכב עליה היא דווקא השאלה המקורית - האם קהילת הבדיקות היא מקום נוקשה? החוויה שלי היא שבדרך כלל לא. הבלוגים שאני קורא (ואני בכוונה מתייחס לאלו שאני קורא, כי הבלוג הזה טרם אירח דיון סוער משום סוג) בדרך כלל שומרים על טון מנומס למדי,והמגיבים השונים נשארים ענייניים למדי, או שהם סתם מפרגנים. יש מדי פעם הערה נבזית או שתיים, אבל ההערות האלה נתקלות בתגובה שמבהירה שהן לגמרי לא במקום. גם פלטפורמות דיון אחרות שאני נחשף אליהן (יש בארץ קבוצת פייסבוק ופורום בתפוז, יש ערוץ slack של testers.io) נשארות מנומסות בדרך כלל. מתישהו במהלך הדיון, אנדרו ציין שהוא כתב בכוונה טקסט שנועד לעורר אנשים לתגובה ולהרגיז אותם, כך שבמובן מסויים הוא הצליח לקבל את מה שכיוון אליו (הניסוח המקורי היה, כמובן, מוצלח יותר) - נראה לי שכאן הוא הצליח לשים את האצבע על הגורם המרכזי בכל הסיפור - מקבלים בחזרה את אותו היחס שנותנים. אם הטקסט מנסה לפרוט לאנשים על עצבים רגישים כדי לגרום להם להגיב, זה בדיוק מה שיקרה, והאנשים לא יטרחו למתן מאוד את התגובות שלהם, כי הטקסט אליו הם מגיבים לא טורח לעשות את זה.
מנגד, אם נזהרים יותר בכתיבה וכותבים טקסט ענייני יותר - גם התגובות תהיינה בהתאם (וכן, יכול להיות שתהיינה פחות תגובות).

אז מה עושים? איך אני יכול לכתוב באופן שיעודד דיון מצד אחד, אבל ירתיע הטחת רפש? אני רוצה לקיים דיונים, כולל כאלה בהם שני הצדדים מסיימים בלי להסכים אבל אחרי שלמדו דבר או שניים על דעתם בעקבות הצורך להסביר אותה לצד השני.
לצערי הרב, התשובה הכנה היא "אין לי מושג". אני כן יכול לנחש על בסיס החוויות שלי כקורא, מגיב וכותב מזדמן.

הדבר הראשון שנראה לי שכדאי לעשות הוא לוודא שהכותרת מתאימה בדיוק לתוכן שנכתב, או שהיא כתובה באופן שלא יעודד אנשים להגיב לכותרת בלבד - אם אפשר לצייץ את הכותרת, או אם היא מרתיחה בפני עצמה (או אפילו סתם מרגיזה), אנשים כנראה יגיבו לכותרת בלבד ולא ממש לתוכן.  בפוסט של אנדרו, למשל, יש נקודה די חשובה - להתעקש על תיקון של כל באג זה לא תמיד דבר טוב, ולמעשה, במקרים לא מעטים זה גם מצביע על עבודת בדיקות גרועה למדי. אבל, הוא קורא להתנהגות הזו bug advocacy, ומכריז "מוות לסנגוריית באגים" (תרגום מילוני ולא מוצלח, אחפש תרגום נורמלי בהזדמנות). כקורא, הכותרת הזו קובעת איך אקרא את כל הפוסט - אני די מחבב את הרעיון של סנגוריית באגים, ולכן אני קורא את הפוסט כולו כשאני מנסה להבין איזו בעייה אנדרו רואה בפעילות הזו - אולי באמת יש משהו שפספסתי. אבל, כשאני עובר על הפוסט, מה שאני רואה הוא שאנדרו משתמש במונח הזה כדי לתאר תופעה שונה לגמרי, או, אם אני בוחר בפרשנות הנחמדה פחות, הוא לגמרי טועה באיך שהוא מבין מהי סנגוריית באגים.  התגובה הראשונית שלי למצב כזה היא "הטמבל הזה שמעולם לא פגשתי כותב שטויות, זה בטח כי הוא לא מבין כלום מהחיים שלו". למה? כי מלכתחילה, כשאני קורא את הפוסט, אני מגיב לכותרת "מוות ל..." ונמצא בהלך רוח קרבי. לעומת זאת, אילו הכותרת הייתה קצת פחות לוחמנית (נניח, משהו בסגנון "סנגוריית באגים, האם זה בעצם דבר רע?") הגישה שלי, כקורא, הייתה פחות מתגוננת ויותר סקרנית.

נקודה שנייה שאני מאמין שיכולה לעזור היא הבהרה של מונחים. אני לא תמיד עושה את זה, אבל כשאני יוצא נגד משהו, אני משתדל להסביר איך אני מבין את התופעה נגדה אני יוצא - רק כדי לצמצם את הסיכוי שמי שלא מסכים איתי עושה את זה על בסיס הסכמה שטחית (בה שני הצדדים מסכימים על מילה, אבל כל אחד מייחס משמעות שונה למילה) כך שנחסך מאיתנו הצורך להסביר אחד לשני את העמדה שלנו. הסכמה שטחית יוצרת בזבוז זמן, כי שאלות וטיעונים שצד אחד משמיע פשוט לא הגיוניים עבור הצד השני ונוצר דו-שיח של חרשים עד שמצליחים לפתור את הבעיה הזו.

נקודה שלישית ואחרונה לעת עתה (כי שלוש זה מספר עגול ויפה) - אני נוטה להאמין ששיתוף חוויות גורר אחריו פחות תגובות עוינות. גם כי החוויה שלי היא רק שלי ולמי שמגיב אין באמת לגיטימציה לבטל את החוויה הזו (אפשר לומר שטעיתי, או שהבנתי משהו לא נכון, אבל כמי שחווה אותה בגוף ראשון, אני יודע טוב יותר מה קרה שם), אבל בעיקר כי על ידי שיתוף חוויה אני משתף הרבה יותר מאשר השורה התחתונה. אני מוביל את הקורא דרך תהליך המחשבה שלי, מדגיש את הנקודות שמשכו את תשומת לבי והובילו אותי למסקנה שלי. למשל, כשכתבתי משהו בגנות כלי בדיקה מבוססי ממשק גרפי יכולתי להסתפק באמירה "כלים גרפיים הם נחותים", אבל אני מאמין שבכך שסיפרתי על החוויה שלי כששיחקתי במכונת משאבי האנוש הצלחתי לגרום לקורא לחשוב קצת לפני התגובה האוטומטית של "איזה שטויות אתה מדבר! אני משתמש readyAPI! ויש לי אחלה אוטומציה שבעולם!!" (אגב, אם זה לא עובד, אשמח לשמוע).

יש כנראה עוד מיליון ואחד דברים שניתן לעשות כדי לעודד דיון מנומס - אבל שלוש נקודות זו התחלה לא רעה. 

Monday, October 24, 2016

שובך יונים

Pigeon hole

(Reaction to an English speaking source, so Hebrew will come later)

I listened to the Gem Hill's latest episode of "let's talk about tests baby" (Ep. 62), where she interviewed Neil Studd and they spoke about some very interesting topics - from motivation, to mental health, working 9 to 5 and coping & promoting change. It was a great episode that I will have to listen to again at least a couple of times to process everything that went there.
As usual, Neil is is always quicker than I am in posting something related, so you can read some background to this interview in his blog.

While I listened to the discussion I re-thought my views on 9 to 5 testers, and despite initially being pretty much in favor of the idea, and that there wasn't a single argument voiced against this approach, I started wondering whether 9 to 5 really is a valid choice. Each and every argument for not doing anything work-related after work is sound and solid, yet somehow each such argument just enforced my gut feeling that it is only a valid reason to completely avoid participation if you don't care.

But before I start, I just want to make sure that I'm clear on what I call 9 to 5 testers, since while I was writing this post I found that it's not the hour cap that bothers me, but what I associate with this term. For me, a  9 to 5 tester is someone who comes to work every morning, leaves somewhere in the evening or even late at night, and have exactly zero interaction with a testing community. They might work 14 hours a day, but if they know only what they see in their own work, I call them 9 to 5 testers.
Another assumption I am making and don't really feel the need to justify, is that testing is an intellectual work - which means that one must take interest in it in order to become really good. I'm not sure I would say that al 9 to 5 testers are bad testers  (though I am quite tempted to say that), but they sure can be much better.

I have mainly the projection of how I feel about my profession - I like being a tester. I think that when you do something you like, you cannot simply stop thinking about it when your shift is over. Just like any other subject - if you invest time thinking about it, you start seeing and interpreting other matters from that unique perspective - football (or soccer, as some of you might call this game) fans, for instance, will often borrow football terms to describe events or ideas that have nothing to do with football since the terms and thought patterns are readily available in their mind. This way, testing, if you care about it, doesn't stop when we're not at the office - we will still smile when we'll see this car and still use insights we learned as testers, or use what we experience outside of work to improve our testing skills. When I can put something aside and say "I don't do anything about it outside of the time I have to", it means that I don't care. Putting aside something I care about is a gradual process - I decide to do something else, then, after the third time I decide it's time to wrap things up, I actually do that, and I will still occasionally think about it.

Neil & Gem mentioned some good and valid reasons for testers not to participate, but while each such reason sounds convincing, I found that I don't see them as good enough to completely avoid participating. There were two distinct reasons I could identify: Having other commitments (such as family or other interests) and Being an introvert, which means one feels drained when socializing.
When facing those reasons as binary questions - there's a clear cut: Work stuff should not trump one's personal life, and forcing someone to overcome their discomforts and fears just because I say so is quite inappropriate. But the question at hand is not Boolean - it's a scale, and there's a world of difference between turning down the dial to a comfortable level and switching it off. I came to this understanding when I've heard Neil describing himself as an introvert, and mentioning that his way of coping with the massive energy drain at CAST was being the first one leaving in order to crash at the hotel (which, at least from my perspective, was completely invisible. I think I recall at least one evening where I left before him, simply since I wanted to get five or six hours of sleep). While I can't really imagine how does being an introvert feels, since I tend to take energy out of interaction (which makes me an extrovert, I think) - but unless we take the extreme case of a person left in a state of acute lethargy or anxiety - Neil describes the  perfect solution: Moderate your participation level. One does not have to attend each and every event, and it's perfectly fine to leave a meetup after an hour or so. It's also ok to prefer small events where you can get to know people. And even if participating in any sort of event is extremely difficult, there are ways to participate online - Writing a blog, or commenting in a web discussion. You gain a bit less from written discussions, but it's still a way to keep track on what's going. People can just share something interesting they read with their team.
Having other interests that take time is a great reason to skip a specific event, or avoid taking on big commitments, but given enough time ahead and high enough priority, scheduling an evening event once every six monts or so is feasible. If someone says "I don't mind going, it's only that I can't fit my schedule", that person is saying "I don't care enough to make time for it". Someone with a tight schedule can still find time to do things that are important enough - it might not be as often as desired, but aiming for an evening once or twice a year is not impossible. There are also some events that take place during work hours - it will take a bit more effort to get permission to attend such an event, but it's doable.

You might have noticed that despite my claim of not approving the "9 to 5" choice, I don't expect everyone to start investing heavily outside of work - There will always be different levels of involvement between people, and that's fine. I get to work every day on my bicycle, and I even enjoy riding a bit in the countryside in weekends. despite that, I wouldn't call myself a bicycle enthusiast - I don't own a 10,000$ bike, have no idea what's the difference between the different brands and part names and I don't spend my time in any biking forum looking for my next trail. Still, since it's something I enjoy - I invest in it a bit. I own a nice pair of bike, I join a riding event once a year and siphon some knowledge about bicycle maintenance and stuff from my local experts. It's a nice thing to talk about with others who bike. Similarly, a tester who has this amount of interest in testing is perfectly fine. I just find it really difficult to imagine such a tester remaining invisible - even such level of care should be visible at least to some of the co-workers around.

-------------------------------------------------------------
הקשבתי לפודקאסט של ג'ם היל (let's talk about test baby), לפרק בו היא אירחה את ניל סטאד ובו הם דנו במגוון נושאים די מעניינים - ממוטיבציה ובריאות נפשית ועד התמודדות עם שינוי ובודקי תוכנה של תשע עד חמש (תשע עד שש בארץ). זה פרק מצויין, ואני כנראה אצטרך להקשיב לו עוד פעמיים לפחות כדי לעכל אותו כהלכה. 
כרגיל, ניל כותב מהר ממני, אז אפשר לקרוא קצת רקע על מה שהוביל לראיון בבלוג שלו.

תוך כדי האזנה, יצא לי לחשוב מחדש על הגישה שלי לאותם בודקי תשע עד חמש, ולמרות שמראש הרעיון נראה לי לגיטימי לגמרי, תוך כדי האזנה הבנתי שאני פחות ופחות מקבל את הגישה הזו. זה היה מעניין, כי כל הטיעונים שנשמעו היו מאוד בעד הרעיון הזה. פתאום, כל טיעון נשמע לי כמו "נכון, אבל בעצם..."
מה שכן - לפני שאני נכנס לעומק ומסביר מה מפריע לי, אולי כדאי להבהיר למה אני קורא בודקי תשע עד חמש: מבחינתי, מי שמגיע לעבודה בבוקר, יוצא ממנה בערב (או מאוחר בלילה) ולא מקיים שום אינטראקציה עם קהילת בודקים כזו או אחרת - הוא בודק של תשע עד חמש. כן, גם אם הוא עובד 14 שעות ביום. 
הנחת היסוד שלי היא שבדיקות היא מקצוע אינטלקטואלי - וככזה, מידת העניין של אדם במה שהוא עושה משליכה על הביצועים שלו. בודק תוכנה שלא מתעניין במה שהוא עושה לא יהיה בהכרח בודק גרוע, אבל הוא בהחלט יהיה פחות טוב מאשר הוא עשוי להיות. 

בגדול, יש לי בעיקר את החוויה שלי להציב מול התמונה של תשע עד חמש - אני נהנה להיות בודק תוכנה. כשאני עושה משהו שאני נהנה ממנו, אני לא יכול פשוט לעצור ולומר "עכשיו די", כי האמירה הזו היא רק ההתחלה. בפעם השלישית בה אני אומר את זה אני גם קם ומפסיק והולך לעשות דברים אחרים. אבל אני לא מפסיק לחשוב על זה - מדי פעם אשקיע קצת זמן בלחשוב על הבעיה איתה אני מתמודד, או בלקרוא משהו קשור פשוט כי הוא מעניין אותי. חוץ מזה, כל תחום בו משקיעים זמן ומחשבה משפיע על הדרך בה אנחנו חושבים על תחומים אחרים. חובבי כדורגל, למשל, ישתמשו מדי פעם במונחים מעולם המשחק כדי לתאר מצבים שאין בינם ובין כדורגל דבר וחצי דבר. באותו אופן - תחום הבדיקות משפיע על שאר החיים של בודקי תוכנה - אובנו לפחות נחייך כשנראה (שוב) את התמונה הזו, ואנחנו יכולים להשתמש בכישורים שרכשנו במהלך העבודה גם מחוצה לה, בדיוק כמו שאנחנו יכולים ללמוד על בדיקות מאירועים שקורים לנו בחיים.

ניל וג'ם העלו כמה סיבות לא רעות בכלל להיות לא מעורבים יותר בקהילת הבודקים (יש יותר מקהילה אחת, אבל זה פחות חשוב לענייננו), ובפרט, אני חושב שאפשר לבודד את הטיעונים שלהם לשני טיעונים מרכזיים - חיים מחוץ לעבודה, והיות האדם מופנם (יש לציין, "מופנם" אינו תרגום מדוייק של introvert במקרה הזה, שכן לא מדובר בביישנות, אלא באנשים שאינטראקציה חברתית שואבת מהם אנרגיה, בניגוד לטיפוס המוחצן שעבורו מפגשים כאלה הם זריקת מרץ של ממש). אם מסתכלים על השאלות האלו כעל שאלות בינאריות, אין ספק שכל אחת מהן בפני עצמה היא סיבה מצויינת לא להשתתף. זה ברור לגמרי שאנשים צריכים לעבוד כדי לחיות ולא לחיות כדי לעבוד, ולהכריח מישהו להתגבר על חרדות, או לשנות את האופי שלו רק כי אני אומר שצריך זה מאוד לא לעניין.
אלא שלא מדובר פה בשחור ולבן, לא נכון להציב "לא משתתף" לעומת "משתתף", כי השתתפות היא סקאלה די רחבה. אם מסתכלים על מידת ההשתתפות, יש הבדל של שמיים וארץ בין "משתתף, אבל רק מעט במידה שנוח לי" ובין "לא משתתף". מבחינתי, רגע ההבנה היה כששמעתי את ניל מגדיר את עצמו כמופנם ומספר על החוייה שלו בCAST, בה הוא מצד אחד נהנה מאוד, מצד שני היה הראשון לצאת בכל ערב כדי לקרוס תשוש בחדרו (לי זכור לפחות ערב אחד בו עזבתי לפניו פשוט כי רציתי להספיק לישון חמש-שש שעות בלילה, כך שמבחינתי המופנמות שלו הייתה שקופה לחלוטין). תיאור הבעייה, למעשה, מכיל גם את תיאור הפיתרון - צריך למצוא את מידת ההשתתפות הנוחה, שלא יוצרת עומס אישי מוגזם. לא חייבים להגיע לכל אירוע קיקיוני שיש בסביבה, ולא חייבים לצאת לכנסים רב-יומיים. זה גם בסדר גמור להגיע למיטאפ ולצאת אחרי שעה-שעה וחצי. ואם המצב באמת קשה - אפשר להשתתף בדיונים אונליין - אפשר לכתוב בבלוג, או להגיב בדיוני פורום כאלה או אחרים (יש גם פייסבוק, אבל אני מתעלם ממנו בכוונה). כן, מקבלים קצת פחות מדיונים כתובים, אבל גם זה משהו. אפשר גם לחלוק עם החב'רה במשרד משהו מעניין שקראתם ולקשקש על זה כמה דקות - מעורבות בקהילת בודקים לא חייבת להיות מעורבות בקהילת בודקים מחוץ לעבודה.

מחויבויות אישיות הן סיבה מצויינת לא להגיע לאירוע ספציפי, או לא להתחייב לשום דבר ארוך טווח או גוזל זמן, אבל בהינתן התראה ארוכה מספיק מראש - אפשר בהחלט לפנות קצת זמן לכל דבר חשוב מספיק, כך שאם מישהו לא מתערב בקהילת בודקים  - לא מגיע לאף אירוע, לא משתתף באף דיון כתוב ולא מוציא את האף מחוץ למשרד והסיבה לכך היא "זה פשוט לא מסתדר לי בלו"ז ", המסקנה היחידה שאני יכול להגיע אליה היא שלא אכפת לו מספיק כדי למצוא לזה זמן. כי אם קידום מקצועי בתחום הבדיקות היה מעניין מספיק, אפשר היה לדחוס הגעה למיטאפ פעם בחצי שנה, או לשכנע את ההנהלה לוותר על בוקר אחד וללכת לאירוע שמתרחש בשעות היום (היה אחד שמטריקס ארגנו לא מזמן).

בטח שמתם לב שלמרות שאני מוחה בתוקף נגד בודקי תשע עד חמש, אני לא ממש מצפה מכולם להפוך סדרי עולם ולהשקיע שעות על גבי שעות מחוץ לזמן העבודה, או לבזבז חצי מיום העבודה על דברים לא קשורים - תמיד יש רמות מעורבות שונות, וזה בסדר גמור. אני, למשל, מגיע לעבודה לא מעט על אופניים, וגם נהנה לרכוב לטיולים מדי פעם. עדיין, לא הייתי מגדיר את עצמי כחובב אופניים - אין לי אופניים בשווי עשרת אלפים דולר, אני לא מכיר את כל השמות המשונים שיש לחלקי האופניים (עשר נקודות למי שיודע לומר מה זה "נאבה" בלי לבדוק) ואני לא מבלה בפורומים של רוכבי אופניים בחיפוש אחרי המסלול הבא. למרות זאת - כיוון שזה משהו שאני נהנה ממנו, כן השקעתי קצת מאמץ ולמדתי איך לתחזק את האופניים, יש לי זוג אופניים נחמד ואפילו השתתפתי בסובב ירושלים. מדי פעם אני שואב קצת מידע ממומחי האופניים שיש בסביבתי, וזה נושא נחמד לשיחת חולין עם רוכבי אופניים אחרים. בעיקר - כל מי שמכיר אותי יודע שאני רוכב על אופניים. באופן דומה - נראה לי סביר לצפות שאנשים סביב בודק תוכנה ידעו שבדיקות תוכנה זה משהו שמעניין אותו - לא בהכרח הקדימות העליונה, אבל משהו שהוא מתעניין בו.

Thursday, October 13, 2016

בעייה ייצוגית

Advocating for a user?

(Note: Even though the trigger for this post came from an English speaking source, I don't really consider it a reaction, so English will be at the end, as usual.)

מדי פעם יוצא לי לשמוע מישהו שמזכיר ש"בודק תוכנה הוא מי שמייצג את המשתמש בתוכנה", ונראה לי שהגיע הזמן להפסיק לומר את השטות הספציפית הזו. הפעם, התזכורת לכך הגיעה אלי כשהקשבתי לריאיון של ג'ו קולאנטוניו עם מליסה טונדי (אגב, אם טרם שמעתם על הפודקאסט שלו, אני די נהנה ממנו). הראיון לא מתעסק בנושא הזה, אבל מתישהו באמצע הוא פשוט צץ ועולה פחות או יותר בדרך אגב כשג'ו שואל על ההרצאה של מליסה "איזון בין מיומנות טכנית לבין ייצוג המשתמש (user advocacy)" ונראה ששניהם מקבלים כנתון את הגישה לפיה בודקי תוכנה מייצגים את המשתמש. 
ובכן:

בודק תוכנה, במרבית המקרים, לא יכול לייצג את המשתמש, ולא צריך לעשות זאת. קודם כל, כי הלקוח אינו זה שמשלם את המשכורת שלנו. כבודק תוכנה, אנחנו נשכרים כדי לשרת את האינטרסים של המעסיק שלנו. נכון, במקרים רבים, חשוב למעסיק לדעת, או לפחות להעריך, מה תהיה תגובת המשתמש או מה הוא ירצה, אבל לא תמיד זה הדבר היעיל ביותר שאנחנו יכולים לעשות עם הזמן שלנו. מעבר לכך, זה נכון שבאגים שלא מתממשים לא מעניינים אף אחד - אבל לחקות פעולות משתמש זו לא האסטרטגיה הכי טובה כדי לאתר בעיות חשובות. ישנם גם דברים שלא מעניינים את המשתמש, אבל צריכים בהחלט לעניין בודקי תוכנה (למשל - שמירה על קוד נקי ועיצוב תוכנה פשוט הם אינטרסים של הצוות, ובהחלט נמצאים בתוך תחום ההשפעה של בודקי תוכנה). 
חוץ מזה - בלא מעט מקרים, בודק תוכנה לא יכול לייצג את המשתמש בשום צורה, כי הוא לא ישתמש בתוכנה הזו אף פעם למעט בזמן בדיקות. לכמה בודקי תוכנה יש רקע בנקאי? או רקע בהנדסת בניין? בהטסת מטוסים? בחינוך? בהנהלת חשבונות? כמה בודקי תוכנה מסוגלים לייצג משתמשים מעשר מדינות שונות?

מה שגרוע יותר הוא שכל עוד האמירה הזו נמצאת שם בחוץ, היא מייצרת את התפיסה שהיכולת המרכזית החשובה לבודק היא הזדהות עם המשתמש, ולכן משתמשים אמיתיים יכולים להיות בודקי תוכנה (מה שעשוי להיות נכון, בדיוק כמו שהם עשויים להיות מתכנתים טובים, או רופאים מומחים. פשוט אין שום קשר בין היות אדם משתמש להתאמה שלו לבדיקות תוכנה של מוצר). גם אם נקבל את הגישה המצמצמת לפיה תפקידו של בודק תוכנה הוא למצוא בעיות (גישה שאני לא מקבל. אפשר לקרוא כמה מחשבות ראשוניות כאן) - בעיות של "המשתמש ירצה לפעול כך" הן חלק מאוד קטן מסך הבעיות המעניינות. אף משתמש לגיטימי לא רוצה שהעבודה שלו תרד לטמיון כי יש עוד שלושת אלפים משתמשים ואחד מהם ביצע פעולה ספציפית יחד איתו, והוא גם לא חושב על האפשרות הזו (אבל בודק תוכנה צריך). לאף משתמש לא אכפת האם פעולות הניהול של המערכת נרשמות ומנוטרות באופן מאובטח (אבל בלי זה הביקורת הבאה עשויה לשלול את הרישיון). אף משתמש לא יתנגד לקבל הנחה של חצי מחיר בגלל באג בחישוב החשבוניות (אבל למנהל החשבונות אכפת, מאוד). כשאנחנו ניגשים לבדוק תוכנה, יש כל כך הרבה יותר שצריך לעשות מאשר סתם לחשוב כמו משתמש - אולי כדאי שנתחיל לומר את זה. 



-------------------------------------------------------------------------
Every now and then I hear someone mentioning that "A tester is the user's advocate", and I believe it's time we've stopped repeating this mistake. This time, I was reminded of this saying when I listened to Joe Colantonio's interview with Melissa Tondi (By the way, if you haven't heard Joe's podcast, I quite enjoy it), when he asked about Melissa's talk in STPCon about "balancing technical acumen and user advocacy" (around the 16th minute), and it seems that they both accept without question the statement that a tester is expected to advocate for a user (to be fair, they mentioned a pendulum movement between being "technical" and representing a user). 
Well :
Software testers, in most cases, can't represent the user efficiently, and shouldn't do so even when we can. First and foremost - because the user isn't the one paying our salaries. We are hired to promote our employer's interests. Sure, those interests often include caring for the wants and needs of the end user, but it's not always the most efficient use of our time. And while it's true that bugs that are not manifesting in real usage are not really a concern, but acting as a user isn't necessarily the best way to find interesting problems. There are also things that are of no interest to the user, but should definitely interest a tester (For example: code tidiness and simple design are a in the best interest of the team, and are definitely within the testers' scope). 
Besides, in many cases, a tester simply cannot represent the user - How many of us have banking experience? or civil engineering? Doctoring? Piloting? education? accounting? How many of us can represent users from ten different countries?

What's worse is that as long as this saying is still out there, it creates the misconception that the main capability of a tester is to think like the user, and therefore a real user would be a great tester (They might be, just as they might happen to be great developers or expert doctors, but there's no relation between their skill as tester and the fact that they are real users). 
Even if we accept the narrow view that preaches that a tester's role is to find bugs (which I don't. you can see some initial thought around it here), "The user will want to act *this* way" is a very small subset of the interesting problems a tester should search for. No legitimate user would want their work to be lost just because one of the other 3000 concurrent users have performed an action at the exact right moment to cause a race condition - but no user will ever be concerned  about such a thing (While a tester should be). No legitimate user cares about how the system management actions are being monitored (but a problem there might cause a security auditor to disqualify the product). No user will object buying stuff at a 50% discount due to a software bug in the billing system (but the finance team will dearly care about it). When we go and test a piece of software, there's so much more that we do than just "think like a user" - we should start saying that.

Sunday, October 2, 2016

Landslide

(No Hebrew this time, and for once, I don't feel a need to explain why)

It just so happen that I was a bit late on my reading list, and so I heard about what is now referred as "The slide" (or "the slide incident"). And my first encounter with it was through Maaret's blog (here). I started by reading the slide's content - not knowing a thing about the context in which it was presented, what was said alongside it, or what Maaret had to say about it. My first feeling was that I am just seeing someone sneak a nasty punch to the face (something a bit like this). And, as we all know - emotions are an oracle that should be considered. So, with that preliminary uncomfortable feeling I set out to read what is this all about. By the end of the post, I felt an urge to express my disagreement with what I saw in the slide, since I interpreted it as injustice, and staying silent when faced with injustice is almost as worse as taking part in it.
Still, I took my time - I could not find proper words for it. There was no need to "go out and help" Maaret, since she can stand her ground better than I can stand mine, and seemed to handle it pretty well, so there was no urgency, and I wondered if perhaps I should let this one pass along. Maybe I am missing some details? Surely I should hear what James has to say about it first, because I don't suspect his goal was to throw such an insult.
Today I progressed a bit more in my reading list, and got to some of the reactions - James's post, Kate Falanga's post (which, according to her, might be removed in the future), and probably Patrick Prill's post as well.
I won't pretend that I have now a better understanding of what actually happened, but my gut-feeling was not eased. The fact that two people I deeply appreciate, and have learned a lot from materials they have created or talks I had with (I have spoken with Maaret at the last European test conference, and while I haven't met James face-to face, I emailed him once when I had a question - which lead to an interesting discussion I learned a lot from) are at odds with each other is quite discomforting, since transforming a professional discussion to a personal argument makes me question the maturity of the profession (or rather, the communities I take part in) and it's ability to contain constructive disagreements.
As it so happens, tomorrow is the Jewish new-year, and ten days after comes Yom-Kippur, the day of judgement (literally, "Day of atonement"). These days are known as "the ten days of repentance", where everyone asks for their sins to be forgiven. In the Judaic tradition, there are four steps to penance: recognizing a sin, abandoning it, deciding not to repeat it, and confessing.
Personally, I'm not a fan of confessions in most cases, but I really like the first three steps.
From what I have understood of James's post, the summary is something along the lines of "I am sorry that Maaret's feeling were hurt, and this wasn't my intention, but I think what I did was perfectly legitimate and would act similarly in the future" (do check me up on this, it is possible that I have misunderstood the post, or missed something critical).
So, I want to focus on why I think having such a slide is not proper.
First of all, there is the actual result - regardless of intent or other possible ways to interpret the slide, many people (myself included, and that's one of the main reasons I'm writing) have understood it as an attack on Maaret. If there's a mismatch between the expected reality and the actual reality, it does not matter how solid was the reasoning, since it was clearly wrong. It's ok to make mistakes, but it is important to recognize them in retrospect and act upon such recognition.
Second - There's a world of difference between quoting someone and interpreting them - it can be acceptable to honestly quote from someone and say "I don't agree with that". It's less fine to build a straw-man around an interpretation of what the speaker understood - because it's likely to be inaccurate. A good way to mitigate this would be to approach the person thus quoted and ask them to review your ideas and make sure that the interpretation is close enough to the intent.
Third - when standing on the podium, the speaker is quite powerful (just as I am here, in my blog): the slides and narration are setting the tone, and the speaker is now the source of authority. putting publicly questioning someone who is, currently, in a less authoritative position, is a violent act. Sometimes, such violent acts are in place (for instance, I believe this post is such an act).

Fourth - A speaker should assess the way his story will be understood. The specific format in which the slide was built is inviting an interpretation of accusation. For instance, if I would "reverse" the slide, it might look something like this:
How I differ from James?

  • I value collaboration. I don't waste time on futile quarrels. I want to collaborate while remaining true to my standards. 
  • I think dialogue is critical to learning and to the maintenance of a respectable craft. 
  • I don't believe experts should limit their contribution only to the narrow field in which they specialize.
Now, the naïve way of understanding these three bullets is that I claim that James is anti-collaboration, does not believe in dialogue as a learning method, and is needlessly limiting his scope. Sure, I can say that anyone who have seen the slide I was referring to will know that I actually mean that I put a strong value on collaboration, and that I see "niceness" as a strong collaborative tool, while James puts a stronger stress on staying true to his core values. I don't imagine he has anything against collaboration, he just places it in a lower priority (which, unlike opposing it, is quite reasonable) - But the slide I present does not reflect that context, and does not reflect the complexity of my idea. In fact, I cannot present such a slide without reminding the audience what I actually mean (or, to put it to the extreme, I will say something such as "don't take this slide as is, what I actually meant is..."), and I don't think a slide that should always be followed by a cautionary explanation is a good slide to have (unless someone wants to insult people).

And lastly, why don't I want to see such slides in the future:
In a short comedy piece quite familiar in Israel the comedian defines dialogue as "two persons talking to themselves" (Luckily, the piece is framed as "English lesson in an Arab classroom", so most of the text is in English with a fake Arab accent, and everything but the first 20 seconds is accessible to anyone who understands English. You might enjoy it). In the professional community I want to be a part of, people listen to each other, and learn from each other (or learn by listening to counter-arguments and defending one's stance). When people are offended, we digress to the state where people are talking to themselves instead of talking with each other. So yes - it is vital to keep integrity and sometimes to say things that are difficult to hear (and to say), but this is exactly where politeness, respect for others and kindness can facilitate the flow of information, and help opening people to ideas and opinions instead of shutting them out. I want to hear people who disagree, I have gained a lot from listening to both James and Maaret, and to see a wall growing between them (or, as James stated in his blog "I will no longer be conferring with her, until and unless those differences are resolved") makes me a bit sad. 
 

Wednesday, September 28, 2016

רכיבה על אופניים חשמליים

Riding an electric bike

אחרי שהשוויתי בין כתיבת בדיקות לרכיבה על אופניים, השתעשעתי עוד קצת עם הרעיון, ועצרתי לחשוב עוד קצת על כלים שנועדו לספק לבודקים שאינם מתכנתים יכולות כלשהן בייצור בדיקות אוטומטיות, והאנלוגיה שהתקבעה לי בראש היא אופניים חשמליים. 
אופניים חשמליים הם רעיון נהדר - כלי תחבורה זול,נייד וקל שאינו מזהם מאוד את הסביבה, לא דורש רישיון נהיגה, לא סובל מפקקים ובזכות המנוע החשמלי, לא באמת חייבים למצוא מקלחת במקום היעד. אבל הרעיון הנהדר הזה נשאר על הנייר בלבד. בפועל אופניים חשמליים מטילים אימה על הולכי הרגל על המדרכות, ורוכבים רבים שוברים גפיים, או גרוע מכך. לא בדקתי את הנתונים בצורה מעמיקה, אבל המספרים בהם נתקלתי מדברים על שני פצועים ביום בממוצע (נדמה לי שבשנת 2014) שהיו מעורבים בתאונות אופניים חשמליים - הן רוכבים והן הולכי רגל. ובכנות? לא משנה עד כמה גבוהים יהיו המספרים בהם אתקל - ככל הנראה אהיה מוכן להאמין להם, כי כמעט לא עובר יום בו אני לא רואה רוכב אופניים חשמליים שמתנהג בצורה לא בטוחה. 
יש מגוון רחב של סיבות להתנהגות הפרועה של רוכבי אופניים חשמליים, אבל המשמעותית ביותר לדעתי (ושוב, לא בדקתי את העניין בצורה מסודרת) היא העובדה שיש לאופניים האלה יותר מדי כוח. רוכב אופניים רגילים שינסה לשלוח מסרון תוך כדי רכיבה ימצא את עצמו בתוך חמש שניות על הרצפה. על אופניים חשמליים - לא בהכרח. רגלי הרוכבים על אופניים חשמליים מונחות על הדוושות, כי אחרת האופניים לא יזוזו. באופניים חשמלים כבר ראיתי רוכבים שמניחים רגל אחת על הרמה, ורוכבת אחת שהגדילה לעשות וישבה כששתי הרגליים שלה מקופלות על הרמה במה שנראה כמעט כמו ישיבה מזרחית, עם יד אחת על הכידון, כי השנייה החזיקה פלאפון. ובדרך כלל - למרות מרכז הכובד הגבוה יותר, למרות חוסר תשומת הלב הכללית, הרוכבים הפרועים האלה לא נופלים. עד שפעם אחת הם כן. או שהם לא שמים לב ודורסים מישהו.

מוצרי מדף שנמכרים תחת "פתרון האוטומציה שהחברה שלך צריכה" או "אוטומציה בכמה שלבים פשוטים" הגיעו למצב בו אפשר להשוות אותם לאופניים חשמליים. כשאני הגעתי לעבודה, היינו בשלבים מתקדמים של היפטרות מכלי בשם Badboy - כלי הקלטה ושידור של דפדפן, שמשתמש בדפדפן משל עצמו. וגם נראה די מכוער. עבודה עם כלי כזה לא תבלבל אף אחד - אנחנו צריכים אוטומציה שעובדת טוב יותר, ואולי הגיע הזמן לשכור מישהו עם הכישורים המתאימים. לא שהכלי רע במיוחד, אבל הוא לא עוזר עם כיסוי דפדפנים (כי הוא דפדפן משל עצמו) והממשק המכוער פשוט לא נוח במיוחד לתפעול. 
מצד שני - אם נשווה את המוצר הזה למוצר של Testim.io, שני המוצרים עושים את אותו הדבר, אבל טסטים נראה יפה, רץ על כרום ומספק כל מיני שירותים מגניבים כמו הקלטה של כל הבדיקות שרצו. כשעובדים עם כלי כזה - לא כל כך קל לשים לב שהבדיקות שאנחנו מייצרים מוגבלות באופיין. ואם אנחנו עוברים מבדיקות דפדפנים לתחום אחר, כמו למשל בקשות SOAP, המצב הולך ומשתפר: כלים כמו Ready!API מספקים די כוח כדי לענות על צורכי הבדיקות של כל מיני מוצרים באופן טוב מאוד - מקליטים כמה בקשות, או אפילו רק מספקים לכלי WSDL ומקבלים ממשק נוח מאוד לבדיקות פונקציונליות (שבניגוד לכלי ההקלטה שמזיזים דפדפנים, מכילות גם הפנייה לבדיקות מסדי נתונים בצורה מובנה), בדיקות עומסים, לפחות בקטנה, ובדיקות אבטחה בקליק אחד. ואם כל זה עדיין לא שכנע אתכם, החבילה כוללת גם שירות סימולציה שמאפשר לקבוע את התשובות שיוחזרו לבקשות השונות.  בקיצור - אם אתם משתמשים בכלי הזה, לא חסר לכם הרבה. 

וזה דבר טוב, נכון? אנחנו יכולים להפסיק להתעסק בכל הדברים הטכניים שחוסמים אותנו ולהתמקד בבדיקות. וכבר לא צריך לדעת לתכנת כדי ליצור אוטומציה שימושית. הטוב שבכל העולמות!
ובכן - לא.
הכלים האלה, בסופו של יום, מוגבלים. אולי מדובר במשהו שפשוט נמצא מחוץ לגבולות הגזרה של הכלי (Ready! API לא מיועד לאוטומציה של דפדפנים, למשל, וטסטים לא מתעסק בשום דבר מחוץ לדפדפן), או שסתם מדובר בנושא שהכלי לא טוב בו במיוחד. אבל עם הכלים הנוצצים והחזקים שיש היום בשוק -  קשה יותר לבנות טיעון נגד הסתמכות על הכלי, וחברות רבות עשויות להסתפק בבדיקות סוג ב', כי למה להתחיל ולבנות פרוייקט תכנותי מורכב שצריך לתחזק מרמת התשתיות ומעלה, כשכל מה שצריך לעשות הוא להריץ את הכלי הנפלא שקנינו - ובדרך כלל אפשר גם להריץ אותו משורת הפקודה? וזה שצריך להגדיר את הכלי בנפרד משאר המוצר? בסדר, פעם ב... יגיע אחד הבודקים ויסדר את התרחישים המורצים, או ישנה את הפרמטרים שנשלחים אליהם. אז זה קצת מציק. אז מה? בשביל זה לשלם לבודק שיודע לתכנת?
חוץ מזה - כאשר משתמשים בכלי כולל שכזה, לא באמת יודעים מה קורה מתחת למכסה המנוע. ואז, אם פתאום משהו לא עובד - אין לאף אחד את היכולת לחטט פנימה ולתקן את הבעיה, כך שצריך להסתמך על התמיכה של מי שמייצר את הכלי.
וכמו באופניים חשמליים - מדי פעם נופלים. לפעמים קורה מקרה ומגלים שהכלי כבר לא מספק את צרכי הארגון - כי הארגון השתנה, או שצורכי הבדיקות גדלו. במקרה כזה, המחיר המושקע בכלי עלול להיות גבוה מאוד - ועלות המעבר גבוהה אפילו יותר.
ונקודת דמיון אחרונה ששמתי לב אליה תוך כדי כתיבה - רוכבי אופניים רגילים נוטים להסתכל על רוכבי האופניים החשמליים בבוז מסויים, או אולי מדוייק יותר לומר - בהתנשאות. זה לא משנה שהם עצמם יכולים לתאר כמה וכמה מקרים בהם אופניים חשמליים הם הבחירה הנכונה (למשל - "אין לי מקלחת בעבודה"), תחושת ההתנשאות עדיין קיימת.
הדבר דומה לגבי כתיבת אוטומציה ללא תכנות - למרות שאני, כבודק שמתכנת, יכול לתאר כמה תרחישים בהם הבחירה הנכונה היא להשתמש בכלי מוכן מראש, עדיין, אני מרגיש את אותו דחף מתנשא כשאני שומע על מישהו שמבסס את הבדיקות האוטומטיות שלו על כלי שכזה.

-----------------------------------------------------------------------
After I've compared between writing automated checks and riding a bike, I played a bit longer with the idea, and thought about tools that were meant to provide non-programmers with automated checks capabilities. The metaphor that stuck in my mind was riding an electric bicycle.
In theory - Electric bike is a great idea. It's relatively cheap, relatively eco-friendly, and does not involve all of that sweating and effort  that prevents people from using it as a transportation vessel  for short & medium ranges. Riding a bike saves time for just about every ride inside a city, reduces traffic jams (or at least, mostly unaffected by it) and is generally fun. Unless rain is a problem for you - there are not that many reasons not to use it. You don't even need a driving license for it.
However, in practice (at least here in Israel), the reality is quite different - a combination of poor infrastructure and some other factors (such as the young age of many electro-cyclists), results in cyclists terrorizing pedestrians, and being involved in an unproportional amount of accidents that are not as common with regular cyclists (I didn't manage to find official figures, but the numbers I've seen while searching were around 2 injured people per day during 2014, including pedestrians that were run-over by an electric bike, while regular cyclists are mainly counted as "were hit by a car" and get to a bit less than one a day). But honestly - I am willing to believe just about any ridiculously high number I might hear, since I see how electric cars are being used. I've seen electro-cyclists ride with their eyes in their phone (held in one hand), riding in couples or even triplets, or folding a leg beneath the rider, and even one time I saw a rider with both legs on the top tube (The phone, naturally, was in one hand).
Each and every time I see such a thing I ask myself "why are they doing that?" And each and every time I answer "because they can". While using the pedals, there are a lot of forces moving in many directions - were I to look at my phone while on my bike, It would take me less than 10 seconds to fall to the ground. I must constantly look ahead to see if I will need to shift gears, and picking a friend on my bike will mean more effort for me. With electric bicycle, those "costs" are not really visible. People don't have to be as attentive and as careful, they can reach a grater velocity without any effort, and they can get out with losing concentration for more than a couple of seconds.
That is, until one time they can't. An accident caused by an inattentive electric rider is more likely to cause grater damage - It's faster, heavier (if giving a friend a ride) and by the time the rider gets to the brakes, the accident has already happened.

Tools that are marketed under "the end to your automation problems" or "everything your automation needs" (not to mention "code-less automation) have finally reached the point where we can compare them to electric bike. When I first got to work, we were in the late phases of getting rid of a tool called "Badboy", and it was fairly obvious why - It was a record & playback tool, that used it's own proprietary browser to run. Anyone looking at it could tell that it might be a good time to hire someone who can do a better work. The tools wasn't really bad, but it didn't help with actual browser coverage, and most importantly - it was ugly and uncomfortable to use.
One the other hand, we can look at Testim.io - this is a newer record & playback tool, that works on chrome, looks nice and modern, and provides a bunch of useful things such as grouping actions for reuse, some strong built in validations, and a test report with images. A great time-saver. Working with such a tool, it's not that easy to notice that we are missing stuff (the first thing that comes to mind is non-web stuff, such as database checks). And, if we move to some non-browser tools - we get an even more complete and powerful tool, such as Ready!API by SmartBear for SOAP\REST testing which provides, on top of DB checks and strong validations with a simple way to setup things (just add a WSDL, and you're good to go) some neat capabilities such as automated security and load checks and even some simulation services that enables mocking (and controlling) the response for a request.
So, we're making a great progress, right?  We can leverage those tools to get rid of the infrastructure fuss and focus on creating checks. We don't even need to know how to code. The best of all worlds!

Well... no. Not really.
Those tools, powerful as they might seem, are pretty limited. It might be because GUI is not really suitable for programming complicated logic, or simply a limitation of the tool's scope (Browser testing, for instance, is out of scope for Ready!API). But with the shiny tools out there today, it's getting more and more difficult to build a case against using them, or for migrating out, because we do gain a lot out of them. So why should a company invest in building an extendable, tailored test harness, when we can get all of those cool things for the price of using a tool? Most tools can even be run from the command line, and thus integrate into our CI. And the fact that the tool is configured outside of the main product's code? that's fine. Every now and then we'll just have a tester go and update the scenario parameters. for that small nuisance, why should we pay for testers that can code?
Besides, when using a tool, there's only so much you can know about the tool's internals and what's actually going on in your tests - and if something isn't working, you can't just peek under the hood and fix it - you have to contact the vendor support (or, if it's an open source tool - you can start diving into the code and compile your own version of it, and it will be quite painful to do).
Also, to return to our bicycle analogy - it's great to ride while using the phone and zooming around, and you will normally stay out of trouble - until suddenly, you don't. If you get to a conclusion that the tool you're using is no longer doing the work you need - it will be that much harder to migrate out of it, and to develop all those nice capabilities you've grown accustomed to in your framework.

And, one last point of similarity I found while writing this blog - regular bicycle riders tend to sneer and look down at electric cyclists. They can come up with several scenarios where using them is an acceptable choice (for instance "I don't have a shower at work" is an acceptable excuse), but every time I see someone riding an electric bike I get that feeling of moral superiority. I've noticed pretty much the same feeling towards tool users - despite the fact that I can describe several scenarios where using a tool is better than writing everything at home - as a tester who codes, I can't help it but look down on testers who automate without coding. 

Thursday, September 15, 2016

לרכוב בלי גלגלי עזר

Riding without training wheels

(English first, as this is also a response to a source whose owner probably does not speak Hebrew)

I'm assuming you have at least heard of Gem Hill's podcast let's talk about tests baby and if you didn't, go and listen to a few episodes - they are short and I usually find them interesting.  I've listened to the episode on using selenium IDE. It just so happens that on the same day I've listened to it, I also attended a local selenium meetup (which, in case you live in Israel, or just happen to be in the neighborhood when one is occurring, can be found here) and after the meetup a few of us grabbed a cup of coffee (tea in my case) and continued to chat for a bit. One of the subjects that came up during this chat was about record and playback tools. If you've read this post you can probably guess that I feel very strongly against this kind of tools.
Listening to Gem's podcast, I noted that I was listening to the rare occasion where the person using selenium IDE1 is doing it properly with the right goals in mind - create a base, use the recording to flesh out some crude scaffolding quickly and then go and fix the generated code. Then, after the chat I had following the meetup, I thought about it a bit more, and realized I don't like selenium IDE even when it's used responsibly (Though, if I understood correctly, Gem's done it right - use once or twice to bootstrap the code, then defenestrate).
Why? Because it's like riding with training wheels.
When I was young, like all of the kids around my age, I had a bicycle with training wheels, and I rode them around. At some point, came the time for me to remove them, and my father spent several hours running behind me, holding the bicycle rack and releasing it when I wasn't noticing. If you've been anywhere near bicycles lately, you probably know that the new fashion on teaching kinds to ride is by having them ride a balance bike - the reason is simple: When using training wheels the kid might get used to using the pedals and the breaks, but will miss the most important thing - learning to self balance on the bicycle. You also acquire some bad habits you will need to get rid of when you'll later learn to properly ride a bike (for instance, the way you turn around is completely different). Finally,  removing the training wheels is quite scary.

The same is true for using selenium IDE - it helps you do something that looks a lot like writing an automated check, and using it you are able to get some results that are (at least at the beginning) better than not using it, but by using it, you are missing the central skill that is required to write decent automated checks - which is the ability to think in algorithms and organize code in a reasonable way.  And just like training wheels, it can be very scary to let go of it. Worse - using it as a learning tool leads to learning some bad habits - such as having each script live in it's own world, initialize everything for itself and so on. In fact, if we were to convert a recorded script to fit into a proper test infrastructure, not a single line of code will remain - initialization and teardown code will be in the superclass, every selenium code will be in the page-objects, and chances are that even page-objects will be hidden beneath another abstraction level. A bad habit that is a bit harder to shrug off is that by using Selenium IDE we are getting used to try and mimic human actions with our automation and completely ignore the fact that humans and computers are different - and things that are easy for a human being are sometimes difficult, or impossible, for a computer - and vice versa. In addition, recorded scripts are usually quite meaningless in terms of what they actually validate.

So, what should we do? To answer that I want to go back to my bicycle example - How do I like to teach riding a bicycle? I got to do that several times in the past - teaching my cousins, and a couple of friends closer to my age that managed to grow up without learning to ride. What I did was to start from the running point, but instead of holding the bicycle from behind, I run side by side with them, holding them by the shoulder and balancing them until they start doing that themselves. It takes about two hours of doing that before they can ride without my help, and then we go on to the more complicated parts of getting on and off the bike. All in all, after four hours of training, we can ride side by side for a short trip. An equivalent behavior will be learning with a mentor - strong style pairing seems to fit well this image, assuming that there is some basic coding knowledge to begin with (otherwise, focusing on at least some basic coding skills should be the first thing to learn). Lacking a mentor around, I guess you could start by copying some template of "how to write a selenium test in language X" from an online tutorial (there are dozens of them). Though, if you don't have a mentor available to help you, feel free to send me a message (there should be a "contact me" form on the left, or you could leave here a comment) and I'll try to help you getting started - though if you are using a language I'm not familiar with, my help will be limited.





1 Just one note - I use here "selenium IDE" quite often, but if you are actually using selenium IDE, you might want to check out "Selenium Builder", since IDE is planned to reach end-of-life for at least 3 years now. ↩




-----------------------------------
אני מניח שמי שקורא כאן מכיר את הפודקאסט של ג'ם היל let's talk about tests baby, ואם לא - לכו להקשיב לכמה פרקים. הם קצרים, ואני חושב שרובם מעניינים למדי ונעימים להקשבה. האזנתי לפרק האחרון שהתעסק בשימוש בסלניום IDE, ולגמרי במקרה, באותו היום גם השתתפתי במיטאפ סלניום בארץ (אם טרם הגעתם לאחד - למה?). אחרי המפגש נשארנו (לא כולם) לדבר קצת על כוס קפה, ואיכשהו גם כאן השיחה הגיעה לדבר גם על סלניוםIDE. אם יצא לכם לקרוא את הפוסט הזה אתם יודעים מה דעתי על כלי הקלטה. 
תוך כדי הקשבה לפרק, שמתי לב שבאופן שנדיר להיתקל בו, ג'ם משתמשת בסלניום IDE1 בצורה נכונה - היא מקליטה בסיס כלשהו, מייצאת אותו לקוד, ואז עורכת אותו אחרי שיש לה שלד ראשוני, והיא מודעת לחלוטין לכך שזה רק כלי זמני לצורכי לימוד. אבל, אחרי השיחה בערב הבנתי שאני מתנגד אפילו לשימוש הזה בכלי הקלטה. 
למה? כי זה כמו לרכוב על אופניים עם גלגלי עזר. 
כשהייתי ילד היו לי, כמו לכל הילדים בסביבה, אופניים עם גלגלי עזר שאפשרו לי לרכוב מסביב בעצמי. בשלב כזה או אחר הגיע הזמן להוריד את גלגלי העזר ואבא שלי בילה כמה שעות טובות בריצה אחרי כשהוא מחזיק את הסבל ומשחרר אותו בכל הזדמנות בה לא שמתי לב. אם יוצא לכם להסתובב בקרב חובבי אופניים אתם כבר יודעים שהטרנד היום הוא ללמד ילדים בעזרת אופני הליכה. הסיבה לאופנה הזו פשוטה - כשלומדים לרכוב עם גלגלי עזר לומדים להתרגל לרעיון של דיווש, אולי גם מחזקים שרירים מתאימים, אבל מחמיצים לחלוטין את הכישור המרכזי שנדרש ברכיבה על אופניים - היכולת לאזן את הגוף בזמן רכיבה. בנוסף, גם רוכשים כמה הרגלים מהם יהיה צורך להיפטר בהמשך (למשל, הצורה בה פונים בעזרת הכידון על אופניים עם גלגלי עזר שונה לחלוטין מאשר ברכיבה רגילה). וכמובן - זה מפחיד להסיר את גלגלי העזר.
אותו הדבר נכון לגבי סלניום IDE - הקלטה עוזרת לכתוב משהו שנראה כמו בדיקה אוטומטית, והתוצאות שמשיגים בעזרת הכלי הזה עדיפות (לפחות בתחילת הדרך) על התוצאות שניתן להשיג בלעדיו. אבל שימוש בכלי הזה מדלג על הכישור הכי חשוב כדי ליצור בדיקות אוטומטיות  - היכולת לחשוב על אלגוריתם ולארגן קוד בצורה פחות או יותר הגיונית. בדיוק כמו גלגלי עזר, גם על סלניום IDE מפחיד לוותר, וגרוע יותר - רוכשים כמה הרגלים מגונים דרך שימוש בכלי הזה, כמו למשל העובדה שכל סקריפט מוקלט מבצע את פעולות האתחול בעצמו וחי בעולם משלו במקום שקוד האתחול ישב במקום אחד מסודר. למעשה, אם ממירים קוד מוקלט לתוך פרוייקט בו התשתיות מסודרות היטב, לא תישאר שורה אחת מתוך הסקריפט המקורי - קוד האתחול והניקיון אחרי הבדיקה יהיו במחלקה ממנה יורשת מחלקת הבדיקה, קוד סלניום יעבור לתוך page-objects (שבעצמם יהיו חבויים בתוך שכבת אבסטרקציה) ומהבדיקה המקורית לא נשאר כבר כלום. הרגל מגונה שקשה יותר להיפטר ממנו הוא שכלי הקלטה נוטים להרגיל אותנו לחקות פעולות משתמש בעזרת הקוד שלנו ולהתעלם מכך שיש דברים שנכון יותר לעשות אחרת בעזרת מחשב. חוץ מזה, בדיקות שנכתבות בעזרת כלי הקלטה נוטות להיות שטחיות וחסרות שיניים בהשוואה לבדיקות שנכתבו ע"י קוד ויכולות להסתכל על דברים שקורים מחוץ לדפדפן (כמו למשל מסד הנתונים).

אז, מה עושים? לבד זה מפחיד, וגלגלי עזר הם לא פתרון טוב.
כדי לענות על זה אני רוצה לחזור למשל האופניים, ולספר איך אני מלמד לרכוב (אני לא עושה את זה באופן מקצועי במיוחד, אבל יצא לי ללמד כמה בני דודים בגיל הנכון, וכמה חברים בני גילי שהצליחו לגדול בלי ללמוד לרכוב) - אנחנו מתחילים קודם כל מהשלב בו אני רץ לידם (לא מאחור, ליד) ומחזיק אותם בכתפיים כדי לאזן אותם עד שיוכלו לעשות את זה בעצמם. בערך אחרי שעתיים הם מגיעים לנקודה בה הם מסוגלים לרכוב בלעדי, ואז אפשר להתחיל לטפל בנקודות הקשות יותר של לעלות על האופניים ולרדת מהם. בסך הכל, אחרי כארבע שעות (על פני שני מפגשים) אנחנו כבר מסוגלים לרכוב יחד לטיול קצר. המקבילה של זה בעולם התכנות היא עבודה עם מדריך אישי, והרעיון של strong style pairing נראה לי מתאים במיוחד, אם יש ידע כלשהו בתכנות שאפשר לבנות עליו. אם אין ידע כזה, אגב, לרכוש אותו יהיה הצעד הראשון שצריך לעשות בכל מקרה - אין משמעות לשימוש בכלי הקלטה לצורכי לימוד אם אי אפשר להבין את התוצרים של הכלי הזה מספיק כדי לשפר אותם. בהיעדר מדריך זמין, אני מניח שאפשר להסתכל על אחד המדריכים ל"איך לכתוב סלניום בשפה X" באינטרנט (יש לא מעט מהם בחוץ, ואני מחבב את האתר של יוני פלנר שמכיל מדריכים בלא מעט שפות תכנות). אבל, אם אין אף אחד שידריך אתכם, אתם מוזמנים להשתמש בטופס הפנייה שנמצא משמאל, או להשאיר כאן הודעה ואשמח לנסות לעזור לכם להתחיל. 



1 אני משתמש בשם סלניום IDE, אבל אם אתם משתמשים בכלי הזה, עשו לעצמכם טובה והעיפו מבט בSelenium builder שאמור להחליף אותו אחרי שהתמיכה בIDE תסתיים, כמו שאומרים שיקרה כבר לפחות שלוש שנים.  ↩

Wednesday, September 7, 2016

Comic relief



אני מניח שכל מי שקורא כאן מכיר את דילברט, ושאין באמת צורך להציג את הנפשות הפועלות. השבוע פורסם הקומיקס שמופיע פה למעלה). בדרך כלל דילברט משעשע לחצי רגע, ובמקרים מסויימים מעורר תחושת "זה לגמרי ככה אצלי בעבודה!", ופחות או יותר זהו. הפעם, הקומיקס הזה גרם לי לחשוב - הרעיון המרכזי ברור למדי: וולי מדגים שוב את היכולת המופלאה שלו לא לעשות כלום, ולדמות האומללה שמולו אין הרבה מה לעשות כדי לעצור אותו. עד כאן - סטנדרט. 
אבל במשבצת השלישית אפשר לראות משהו מעניין - אחרי שוולי מציין שכל שינוי יגרור עיכובים לא רצויים, מנהל המוצר (אני מניח שזה תפקידו, אולי זה לקוח) שולף את הקלף שתמיד עובד:  "רק שינוי פצפון". אלא שהפעם התגובה אינה התגובה הרגילה- לא שינוי קטן ולא נעליים, ושנינו יודעים שיהיו שינויים. 
וולי שוב מתעצל ומנצח את המערכת, לא? 
כנראה שכן, אבל זה גרם לי לחשוב קצת - בניגוד לסטריפים קודמים באותו נושא (למשל, זה), הפעם מצאתי את עצמי כמעט מסכים עם וולי, או לפחות עם גרסה פחות קריקטוריסטית - שלוש המילים "רק שינוי פצפון" הן רמז למשהו שיותר מדי פעמים מתגלה כהר שלם של עבודה. ומה שעשוי להיראות כשינוי קטנטן מצד המוצר יכול להחביא מאחוריו לא מעט שינויי קוד, מקרי קצה ושאר מרעין בישין. אם נסיר לרגע את ההגזמות והגישה הקריקטורית - מדובר בעצם בגישה מאוד הגיונית.
ולמה עצרתי דווקא במשבצת השלישית? כי זו הנקודה (ויש כזו בחלק גדול מהקומיקסים של דילברט) בה עצרתי ואמרתי "או! זה מוכר לי." כי אחרי הכל, מתי נתקלתם בפרוייקט שלא היו בו כמה וכמה "שינויים קטנים" כאלה? נראה שהדינמיקה הזו מוטמעת היטב בתקשורת היומיומית שלנו - בתוך סביבה לחוצה ממילא, מגיע מנהל המוצר ומבקש שינוי. אין זמן? לא נורא, "זה רק שינוי קטן". ומכאן מתחיל משא ומתן בו אנחנו מבינים ביחד עד כמה קטן השינוי, עד כמה הוא חשוב ומה תהיינה ההשלכות של לבצע אותו.
התגובה של וולי קובעת את אופי ההתנהלות באופן ששומט את השטיח מתחת לצורת התקשורת אליה כולנו (ומנהל המוצר בפרט) רגילים - אין פתח לדיון, אין מניין להתחיל לדבר על שינויים. אולי לכן הבחור בחולצה הכחולה נראה כל כך אבוד.

האם יש לי איזושהי תובנה מיוחדת לגבי כל העניין? לא באמת. בעיקר, המחשבות שלי משוטטות. בינתיים, אני רואה כאן קשר חזק לרעיון ששמעתי ממאט הויזר על "להחזיק מסגרות". וולי מקרין מסגרת באופן חזק מאוד. למעשה, אני לא זוכר מצב בו המסגרת שלו אותגרה אי פעם. בכל פעם בה הוא מדבר עם מישהו, הוא עושה את זה בתנאים שלו. ובעוד שהמסגרת הספציפית שהוא מקרין היא מסגרת הרסנית - אפשר, ורצוי, להשתמש בזה גם לטובה ולהקרין מסגרות מועילות.
תובנות עמוקות יותר, כנראה לא תהיינה. בכל זאת, מדובר בקומיקס משעשע ותו לא.

--------------------------------------
I'm assuming that everyone who reads here is familiar with Dilbert, and that I don't really need to present the characters in it, so you canstart by reading the above comic-strip (or you can read it here). Usually, Dilbert is amusing for a short moment, and sometimes I get a feeling of "I see that all the time at work!", but that's pretty much it. This time, the strip made me think - The main theme is quite clear, and frankly - not new. Wally is demonstrating again his incredible skill of doing absolutely nothing, and the poor character against him has no chance of changing that (or, in the case of PHB, no clue it should change). Up until this point - business as usual. But, if we look closely at the third panel, we see the ace pulled out of the sleeve when the guy in the blue shirt (I assume he's a product owner of a sort - either a PM or a customer) asks about "a tiny change". This always works, right? Well, not this time. The response is actually reversing the usual scenario and turns it against the poor PO.  Every change, no matter how small, will cause tardiness, and we both know there will be some changes...
Wally's laziness wins again, right?
Well, technically, yes. It does match the usual trope. This time, and unlike previous strips (such as this one), I found myself almost agreeing with Wally's approach, or at least with the non-caricature version of it. The words "tiny change" often hint for a major pile of work hiding behind what seems, on the product side, as something small and trivial. It appears to me that this dynamic is embedded in the way we communicate - most of the time we work under some tight schedule constraints (or at least, we have more work to do than time to complete all of it), and within this environment comes the product owner and asks for a change. This is the cue for everyone around to say their equivalent of "no" (usually it's "next sprint", or "next release"), and then the PO comes with "but it's a really small change", and we all engage in a negotiation in which we will discuss the feature's value, urgency, cost and possible trade-offs that can be made. Usually we all leave this discussion more or less content.
Wally's response determines the nature of this conversation in a way that pulls the rug under the communication form that we (and especially the PO) are all accustomed to, so there is no real opening for a discussion or a negotiation. Maybe that's why the guy in the blue shirt looks so lost.

I must admit though that I don't really have a deep insight into this situation - my mind mainly wanders around toying with some ideas. In the meantime, the strongest link I have is to an idea I heard Matt Heusser mention about "Frame control". Wally is projecting his frame very strongly. In fact, I don't recall ever seeing Wally's frame challenged (not to mention seeing him enter someone else's frame). Each and every time he's talking with someone, he does so under his own terms. And, while the specific frame that he projects is a destructive one (as it is based on the sole idea of wally being useless), holding a frame can be done in a productive manner as well.

Chances are that deeper insights won't be coming along - after all, it's just a funny comics.