Monday, November 12, 2018

אולי אחר כך

Myabe later


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




Timing is everything. Or at least that what's everyone says.
Usually, when said in the context of testing, it has one meaning - getting involved earlier.
Naturally, it is not everything. It is just as important to know when to when not to speak, and even when the opportunity to speak is gone.
A couple of months ago, I was abroad participating in CAST (Was great, thanks for asking). Just before I flew over we finished designing a complicated piece of code in a way that I was quite happy with. Two weeks later when I returned I found out that there were some discussions and the design was changed. I didn't really understand or agree with all of the decisions made, but that's fine - I wasn't there when the discussion was taking place and it's unreasonable to expect them to wait for me just because I took a vacation. As I was catching up, I came across another feature where I had some comments. As I spoke with the team member who was working on this I got a response that went along the lines of "there were countless discussions about it, I'm sick and tired of all this so I just do what I'm told". This raised two alarms in my head: First, we have someone who's writing code they don't agree with its design, which is a source of potential mistakes as writing code is much about having a feel of what part fits where and when you write something you disagree with you don't always have that intuitive understanding. The second, more serious alert was that there were some discussions that went wrong, and we were in the domain of proof by exhaustion, and I don't mean the proper mathematical type of exhaustion. In short, now might not be the best time to ask for a major change I thought was required. Instead, I asked for the urgent changes only (you don't want to go and change database tables once in production, it makes it way more difficult in terms of backwards compatibility) and offered to do the work myself - I went to get agreement from the other people, and changed the code. I also left the important but not urgent discussions for later.
My reasoning for not pressing on this argument was simple: Fixing code is easier than fixing people, and it is much easier to deal with a not so perfect piece of code than to deal with a communication problem in the team.
What I didn't take into consideration was, of course, the human nature: After a while, ideas take root in people's mind and they get used to it, so changing their mind now is more difficult. In addition, changing something in retrospect usually takes more effort than changing it while it is being created, so the price of action is higher. 
At the end, we did have another discussion about the design - I can't say I'm super excited with the result (or rather, with the current result, as the solution is inching its way towards the original design that I liked, only with different terminology), but during the years I've learned one thing - While it's easy to think I'm always right (I am, but this is besides the point) The people I work with know software at least as good as I know it. If someone else prefers a solution I don't like it's usually not because they are wrong, but because each of us gives different weights to the various properties of each solution. What was really important was that we discussed our differences and got to an agreement about how we want to push forward. We also added a task to create a diagram of what we've decided to make sure everyone is aligned - which helped us avoid some mistakes in the future since we found some obstacles earlier.

So, to sum things up - Speaking up is not always the right thing to do - as long as you are having those discussions later.

No comments:

Post a Comment