Chapter 6, Galatians. I'll begin reading at verse 1, and I'll read to verse 5, and we'll get into our study. Galatians chapter 6, verses 1 through 5, Brethren, if a man is overtaken in any trespass, you who are spiritual, restore such a one in the spirit of gentleness, considering yourself lest you also be tempted. Bear one another's burdens, and so fulfill the law of Christ. Therefore, if anyone thinks himself to be something when he's nothing, he deceives himself. But let each one examine his own work, and then you will have rejoicing in himself alone and not in another, for each one shall bear his own load. I heard a story. Two young men who had gone through basic training in the army had gone through advanced infantry training. It was during wartime, and they were sent out to the front. And under the heat of battle, one of the young men had been hit. And as he was laying there in the open, he began to cry out for his friend, who was also in the same unit. And as he cried out for his friend, and he said, I'm hit, I'm hit. Well, his friend who had become like a brother to him began to scramble to go get him when the lieutenant in charge said to the one who was about to climb out to get his friend, you need to remain here.  You need to remain here. But the young man disregarded. He disregarded the order, and he crawled out under heavy fire, grabbed his friend by the collar, and dragged him back and pulled him to the safety of cover. And as this young man drew his friend to safety, and the lieutenant was there witnessing all of this, the young man who was hit died. And so the lieutenant looks at the one who had risked his life and said to him, he died. He died.  Are you happy that you did that? And the man who had tried to rescue his friend looked at the lieutenant and said to him, yes, I am. Because when I reached him, my friend said to me, I knew you would come for me. I knew you would come for me. Some of us have friends who have been hit. They've been caught in a trespass. What do we do?  Or do we go out under fire and try and retrieve them? What do we do? When we know somebody who at one time was walking with the Lord and doing well, what do we do when one of them stumbles? It seems to me that the Christian Church has a reputation of shooting the wounded, and I suspect that that may be true in many cases. We have friends and we have brothers, sisters who at one time walk to the house of God with us. Worship the Lord in worship services like we experienced tonight.  And we're going to look at this in some detail tonight. What do we do when we know somebody has blown it, when we know somebody is not doing well? Well, Paul gives to us insight into this, and this is what we'll be looking at tonight. Because as we're about to enter into chapter six, we need to remember that Paul has been encouraging the Church. You see, remember with me again, the context of Galatians is that some false teachers have crept in. They've been bringing in a legalistic approach to a walk with God. They've been saying that for somebody to really have a relationship with God, that they needed to go through certain rituals, certain rules, certain regulations. And they began to infiltrate and began to undermine the teachings that we find in the New Testament that relates to grace. God's unmerited favor. And they began to add legalism. They began to add these regulations. They were telling them you need to be practicing as a Jew in order to understand and know the grace of God. And Paul has been arguing vehemently against that. He calls it a false doctrine. He says that if anybody comes to you and brings a gospel other than the one you've received, let them be accursed because what this is going to bring into the body of Christ is going to be, well, a false gospel and it's going to steal the joy of salvation from those who've experienced it. And so Paul has been encouraging the Galatians to walk in the grace of God and the freedom that comes in knowing Jesus Christ. He's been saying that grace is going to encourage you and set you free to do things and to be something. It's going to encourage you to love. And it's going to encourage you to serve the Lord. And so instead of living just for yourself through the love of God, you're going to learn how to serve others. That's what he said in chapter 5 verse 13 when he said, You brethren have been called to liberty only do not use liberty as an opportunity for the flesh, but through love serve one another. And so he is speaking concerning the fact that God had called the body of Christ, the church, to love one another. Serving one another is the primary evidence that we know and love God. You see, believers don't take advantage of their brothers or sisters. They actually care for one another. Romans 13.10 says that like this, love does no harm to its neighbor. Therefore, love is the fulfillment of the law. And so he's encouraging the body of Christ. And by way of application, though he was speaking to the Galatians 2,000 years ago, he speaks to the church today. And he says, we need to serve one another in love and that's what grace does. It sets you free to serve. Now, how do I do that? Well, we looked at verse 16 in chapter 5. We walk in the spirit. If we walk in the spirit, we don't fulfill the lust of the flesh. We don't give into the cravings of the flesh when we're filled with the spirit of God. Instead of the works of the flesh, we produce the fruit of the spirit and the fruit of the spirit, once again, is love. And if we are serving, if we are loving, well then, even as we saw last time, as it said in verse 26 of chapter 5, we're not going to be conceited. We're not going to provoke one another and we're not going to envy one another. Conceited speaks of eagerness for empty glory that comes from man. Provoking one another means to challenge someone to combat or contest. It speaks about irritating each other. And the word envy speaks of the feeling of resentment aroused by a desire for the possessions or qualities of somebody else. If we are walking in the spirit and we're walking in love and we're serving God and we're serving the body of Christ, then we're going to be evidencing the reality of a God who saves and changes lives. And that's what we've been seeing through chapters 1 up to chapter 5. Now, though we desire to walk in the spirit, obviously we're still capable of failure. None of us is perfect in this room outside of me. None of us is perfect. All of us fail. All of us sin and fall short of the glory of God. All of us are capable of being overtaken by a trespass. Obviously, we're not perfect here on earth. Ecclesiastes 7.20 says, there's not a righteous man on earth who does what is right and never sins. So what happens? What happens when someone fails? What happens when someone sins? Well, that's what Paul is dealing with here in this chapter. And in chapter 6 here in Galatians 1, he begins by saying, brethren, if a man is overtaken in any trespass, you who are spiritual restore such a one in the spirit of gentleness, considering yourself lest you also be tempted. So as we begin, I'll look at a couple of the words and develop it so we get the flow of what he's saying. When he says, if a man is overtaken, that word overtaken means to be surprised by. It speaks of stumbling. It's a result of letting down your guard. It's not something that you are wanting to do. It's something that basically takes you by surprise, and you're surprised that you entered into that. The word trespass is a slip. It's a lapse. It's not a willful sin.  You were overtaken. You see, when a believer stumbles and lapses, Paul says there needs to be something that is done. And what should be done is they should be helped. Sometimes they stumble and fall because they think themselves to be stronger than they actually are. Sometimes people don't, you know, willfully. It's not like they're saying, I'll get drunk today. It's a good day to get bombed. It's not like they wake up and say, let's see, I've been walking with the Lord for a while, but I think I'm going to blow it. I think I'm going to go beat somebody up today. It's just a good day to hit somebody in the head. It's not like that. You didn't wake up saying, I want to do this. I want to violate the law of God. I want to do these things that you are caught by surprise. Sometimes, again, it's because we think we're stronger than we actually are. It's possible that I was trying to live a spirit-filled life with the energy of my own flesh. Whatever the case may be, this is somebody who has fallen.  It's that thing. I have fallen. Somebody has to help me take it up. Before that person even really completely fathoms or realized the full extent of the trespass, he's already done it. That can happen. I mean, you may be seated here tonight saying, I don't know how that's possible. All you need to do is remember what happened in the life of the Apostle Peter. The Apostle Peter was even warned by Jesus, Peter, you're going to deny me three times. And the Apostle Peter, with great emotion, great passion, great vehement, said, never.  There's absolutely no way I'm going to, anyway, shape or form deny you I am 100% on your side. And yet all we need to do is read the scriptures. And we see that he did indeed deny the Lord three times. Did he desire to do that? And did he plan on doing that? Was he not even warned that he would do that? Well, the fact is, you can enter into sin and you can stumble right into it without even realizing it. And that does happen. Well, the question has to be, when that happens, how is it handled? And that's what Paul is speaking about here. When he says, if a man is overtaken, if a man has stumbled, if a man has let his guard down in any trespass, which is, again, something that he didn't plan on doing, well, there's an answer for this. You, who are spiritual, restore such a one. And so his instruction is that spiritual people ought to get involved in their life. The spiritually mature are involved in restoring the weaker brother or the weaker sister. When he speaks of you who are spiritual, this is the ones who are spirit led. This is the one who is what could be referred to as a spiritual expert in mending of souls. This speaks of the spiritually mature individual who encourages those who are weak. The real spiritually mature person is the one who goes out of their way to try and help the one who stumbled. And not the Pharisees. You know, the Pharisees would look at Jesus and wonder, how could you have anything to do with people like that? The Pharisees would see the Lord Jesus Christ who was actually around sinners and tax, you know, publicans, tax collectors and all. And the Pharisees, the religious individuals of the day of Christ would say, look at your master, look at how he's there, look at what he's doing. He's there with these sinners that he's eating with them. And they couldn't understand that. Again, remember the word Pharisee, when we read up the Pharisees, remember the word Pharisee literally means the separated one. And that's what they did. They were individuals who believed themselves to be separated from the ordinary people. They didn't have anything to do with those people who were so casually rejected the things of God. But Jesus, well, Jesus, well, he spent time with the needy people. He spent time with the broken. That's what he did. He was a carpenter. He was used to fixing broken things. And whenever he put something together, let me guarantee you, it was put together perfectly. When Jesus worked, he works perfectly. And when he works in your life, he works perfectly. But he wants you and he wants me, if we're spiritually mature, he wants us to, if you will, be his hands to do the work. That's why Paul is saying here, you who are spiritual restore such a one. In Romans chapter 15, verse one, it says we who are strong ought to bear with the failings of the weak, not to please ourselves. In 1st Thessalonians, Paul writes in chapter five, verse 14, that spiritual believers are to warn the unruly, comfort the faint-hearted, uphold the weak, and he says spiritual believers are patient with all. The spiritually mature have the responsibility of encouraging those who have fallen. The spiritually mature have a heart to restore those who have fallen and those who are hurting. The spiritually mature are the ones who notice that one of their friends isn't in church or one of their friends isn't doing well on the job or one of their friends has been going through it.   And you don't have to tell me everything you're going through. You just need to know that I'm praying for you.  A lot of people, especially in our day, don't get involved in anybody else's life. They're afraid to be meddlers. They're afraid to. But I have to tell you, I have had friends in the past who have cared enough about me, especially as a young believer to put an armor on me and to say to me, I'm here. I'm here for you. I'll be with you. I'll walk with you. I'll walk through this with you. And I have to tell you, I've always appreciated that, having friends like that. When I was going through training, military training, and I see many scriptures that refer to the body of Christ as being a military machine, by the way. But I remember we used to have to run in formation and if one of us could not finish the run and fell out, what would happen is the entire unit that was running would have to make a U-turn, come all the way back and then pick that straggler up and make sure they finished running with everybody. And so there were times that I had guys' arms around my shoulders holding me up because I just didn't want to finish the run. And there were times when I had my arm around somebody helping them so that we all would finish together. That's what the body of Christ is supposed to do. Instead of us just saying, now we'll see you later, we pick them up. We turn back for them. We hold them up. We pray for them. We restore such a one. The word restore is an interesting word. That word restore is found in Mark chapter four, rather Matthew chapter four, verse 21. It speaks of mending nets. The word is used for mending nets, fishing nets. It literally means to equip thoroughly. The word restore was used sometimes in speaking of mending a broken bone or putting a dislocated limb back in place. So restoring speaks about mending. It speaks about bringing somebody back to health. How do we mend a broken Christian? Well, this may not seem obvious at first, but one of the ways to help to heal somebody who is a broken Christian is to help them to see that they've entered into sin.  They're not gonna repent. They're not gonna forsake it and they're not going to receive forgiveness. If they're believers and you're there ministering to them and you begin to share the word of God, it's the word of God that brings healing. And as they hear the word of God, they may not smile at you at that moment and say, oh gee, thank you for letting me know what I've been doing. And as a matter of fact, the normal response is, who are you to judge me? What gave you the right, they get like that.  The dogs, if they're hurt, they crawl into corners and then if you reach there to try and touch them, do they wag their tail and smile at you and say, oh great, I'm glad you're visiting me in the middle of my pain? No, they bite you. They snap at you. They snap at you because they're hurting. That's something that even human beings can do.  Who cares? The spiritually mature expect that. They understand that. They understand that attempting to help somebody doesn't necessarily mean that that person who's that you're trying to help is gonna appreciate it at first, but I tell you something, if you lovingly say, you know, I'm concerned for you and I've noticed this and this is what God's word says related to that, that's why you pray and that's why you spend time in the Word and that's why you go prepared. This is what the word of the Lord says and I just want you to know that God can do a work in you if you just receive and leave it alone. There are times that that person will just, that word that you gave to them will just, it'll just find a place in their heart and they'll begin to think it through and they'll pray and say, you know God, that's true, I have done this, forgive me. If a person who is bringing a word of healing to somebody is mature, then there's a good chance that the person who's receiving the word will accept it, but if the person who's coming to try and bring that person back is just as carnal as the one who's in sin, you're not gonna be received. They're gonna look at you and they're gonna say, why gives you the right to correct me?  Who are you to tell me how to live for Christ? That's why when you read Romans in chapter 15 verse 14, that's why when Paul said I'm confident concerning you, my brother, and that you also are full of goodness, filled with all knowledge, able also to admonish one another. You have a goodness about you and you have a knowledge of the word of God which makes you capable of bringing that to somebody.  And so that simply means that you have a spiritual maturity. Now how do we do that? He says you do that in the spirit of meekness. You do that in the spirit of gentleness. The word gentleness speaks of a mildness. You do it with love and you do it with compassion. You don't do it with self-righteous condemnation. My grandson Josiah was playing a couple of years ago now and he was playing on an outdoor kind of like a jungle gym kind of thing. And he fell and he broke his arm. And little guy five years of age, broken arm. And when you have the arm set, when you've got somebody setting that broken bone, you had better hope that that person doing it is gentle. When you heal a broken bone, when you're there trying to set it properly, do you just kind of grab the arm and twist it around and shove it in there? Yeah, this ought to do. I don't think so. The way you handle a broken bone is with gentleness, isn't it? You do it gently. When I was 17, I busted my wrist. I went to the doctor. The doctor said it gently. He handled it tenderly. And he set the cast in such a way that I was comfortable. That's how you bring a word of correction to somebody. You do it with gentleness. And you do it considering yourself lest you also be tempted. You don't come in with a mentality of self-righteousness. You don't correct somebody with this attitude if I'm better than you, I can't imagine. How did you do that? How could you? You never, never do that. There are some who do. They have that attitude. How could you do that?   Haven't you ever written it? And they come with that attitude. You do it with a gentleness of spirit. You consider yourself. We need to remember that we're made of the same stuff that they are. We need to remember that we can fail and we do fail also. Therefore that ought to produce within us a humility. In Matthew chapter seven verses three through five, Jesus said it like this. He said, why do you look at the speck of sawdust in your brother's eye and pay no attention to the plank in your own? How can you say to your brother, let me take that speck out of your eye when all the time there's a plank in your own eye? And he goes on to say something very kind, you hypocrite. First take the plank out of your own eye and then you will see clearly to remove the speck from your brother's eye. One thing interesting, the plank and the sawdust are made of the same thing. My sins never look so bad until they're practiced by somebody else. And so he says, listen, you're no better.  Here you are trying to fix somebody and you've got this beam in your eye, you're smashing everything around when you move your head and they've got a speck, they've got a bit of sawdust there and because you don't have humility, he was saying, you don't have humility, you think yourself better than they and in reality you need to understand that you're no different than they are when you can enter in to a correction, when you can come in to a restoration, when you come in as a spiritually mature person with the attitude of I have failed too and I understand and I'm no better than you are but I do love you enough to tell you the truth and I wanna see God moving in your life and I have failed and I know what it's like to fall and I know what it's like to be restored and I want you to be restored so that you can once again have the joy of God's salvation and once again you can be used and blessed by God. When you have that attitude, the Lord moves. He says in verse two, bear one another's burdens and so fulfill the law of Christ. Bear one another's burdens. Lock arms, shoulder one another's burdens. Some things need to be carried together. Accountability I believe is of utmost necessity. The fellowship of believers is absolutely important. There are people who are lone ranger Christians, they're isolated, they don't have fellowship, therefore they have no accountability. One of the things that I've discovered in my own spiritual life that is extremely important is an accountability, is relationship with other believers. I really thrive with that. I need friends, I need people who know me and know my weaknesses and love me in spite of them and help me through them, I need that. It's one of the reasons why here in this church when we develop the four pillars that you're all familiar with, the word of God and the worship of God and we created a word, the withness. Well, withness to me is a very important thing. It speaks of fellowship. To me it's a very important thing because I have people that I'm accountable to. I have my board, I have my staff, I have my wife, I have my children, I have my grandchildren, I have my mom, my family, I have my church, I have accountability. I need to have that. I need that in my life. So do you. And when we don't have fellowship, when we don't have friends, when we don't have anybody who can ask us, really, tell me, how is it going with your soul today? Then we can put on that holy smile, we can put on that halo, we can put on that look like we're so solid when in reality we're not. We need to learn that we need each other. We bear one another's burdens. And that way we fulfill the law of Christ. He says in verse three, if anyone thinks himself to be something when he's nothing, he deceives himself. How can I be gentle with somebody else? You know how you do that. And this sounds theoretical and I'm sure there are some heroes say I don't get it and others may, this may resonate with you. How do you do that? Spend time with the Lord. Spend time in the word. Spend time in the gospels especially. And look at Jesus. And look at the way he acted. Look at how he was. Look at the things he did. Look at his patience. Look at his love. Look at his concern. Look at him. I learned and have learned my Christianity by seeing things about the Lord and then reading the things in Paul's writings and the rest. But man, I'll tell you, I look at Jesus and I say, the Jesus is, he was a man's man. I mean, this is a man's man. You know, so I've said this to you before but it really affected me, especially as a growing believer.  You know, where the Jesus that you would see and much of the art was like kind of a wimpy kind of guy. You know, he's got this kind of odd smile in his face and he's carrying a little lamb around and he's kind of all bony and wimpy and I would see these pictures of him and I didn't relate to those. I never really have. And then I started doing some just studying and then I say, well, wait a minute, he was a carpenter and a carpenter means that he wasn't just working with wood. I don't know if you know this or not but the word also is used for a stone mason. So that tells me something about Jesus right away. He didn't go to Bethlehem Lumber and pick up two by fours. He went in and cut down some trees. Or if he was doing some stone masonry, he had the chisel, he had the hammer. That tells me that Jesus would pick up heavy objects, that Jesus' hands were calloused. When you read about Jesus, it speaks concerning him walking from place to place. When they took one day's walk, it was 20 miles. So Jesus could walk in a day around 20 miles and then he'd stop and he'd minister and I started seeing this about him. I started seeing that this is a man who was a man's man. This is a man who had a broad back and this is a man who had powerful biceps, the strong legs, he was a man's man and yet there's this masculine Jesus, not some kind of wimpy guy with some wispy mustache but he probably looked like a Hell's Angel. I mean, when you look at Jesus, now watch somebody who'll write me, I'm just kidding. Not really, he was a man's man and then he had a friend named John. He was actually his cousin, John was Jesus' cousin and Jesus is there reclining at meal and John is putting his head on Jesus' chest. All right, guys, when's the last time you went to a meal and somebody was laying on some one of your buddies at his head on your chest? Are you kidding me? And I read that and it tells me that he was very comfortable with himself and that he was approachable to the degree that he was openly in a caring way for the men that he walked with and taught so that says to me, you can hug another guy and it's okay. Then I read that a friend of his dies, Lazarus, and instead of sucking it up and doing the man thing, he weeps openly and I say, so men can grieve openly and they stay a man or some people come and they bring a baby and hand the baby to Jesus and he actually holds it. See, I come from a culture where the men don't hold the babies, the women do that. We just kind of look at them and say they're ugly. They'll grow out of it, don't worry. But I see Jesus and he holds, I see Jesus telling men, I love you, that's revolutionary to me because guys don't do that, do they? What do we do to show love? We hit each other.  That's what men do. But I see Jesus different and you know what? And this is serious, this is true. It changed my whole life. It changed my life. I got away from my culture and I got into the Bible and I said, I'm gonna be a man. I'm gonna be a man. If I have emotion, I'll show it. I'll tell my kids every day I love them.  I'll tell my daughters they're beautiful. I'll tell my wife every day I adore you. I'll love my family. I'll be a faithful friend. I'm gonna be a man. Not after what the world says a man is, but a man like a real man. I'm gonna be like Jesus. See, that's how that works. It takes time, but you develop that attitude. It takes time, but you begin to realize that without him you're nothing. You see, if anyone thinks himself to be something when he's nothing, he deceives himself. I can treat you kindly because God has shown me kindness. In 1 Corinthians chapter eight verse two, if any man think that he knows anything, he knows nothing yet as he ought to know. In Romans 12 verse three, Paul wrote, I say through the grace given to me to everyone who's among you, not to think of himself more highly than he ought to think, but to think soberly as God has dealt to each one a measure of faith. Think, think of yourself with sobriety. You're not the best thing on the face of the earth and you're not the worst thing. You're somewhere in between. So rather than puffing ourselves up and thinking that we're so great or rather than throwing ourselves down saying, oh, we're just such a worm and so, we just accept who we are. We don't build ourselves up and we don't knock ourselves down. We just are who we are. It's like what Paul said, I am by the grace of God who I am. I know what God has done in my life and I know what he's doing. So you think in an even fashion, he says in verse four, let each one examine his own work and then he will have rejoicing in himself alone and not in another. So before you correct someone else, examine your own life. That'll put you in a position to be able to help somebody else and if you're really honest with yourself, if I'm really honest with myself, I'm gonna see a lack of fruit. I'm gonna see that there's a lot that God needs to do in me. It's like what we read in Psalm 139 verses 23 and 24, search me, oh God, know my heart, try me, know my thoughts, see if there be any wicked way in me. Lead me in the way everlasting. So you examine yourself, you look at your own heart and then he says in verse five, each one shall bear his own load because ultimately the responsibility for our choices rest on us. According to 2 Corinthians 5-10, we must all appear before the judgment seat of Christ that each one may receive what is due him for the things done well in the body, whether good or bad.  All of us are experts at that. I think that one of the legacies that we got from Sigmund Freud and others like him is the ability to point at our moms and dads and other things and say, see that formed me into what I am and we don't take personal responsibility for the things that we've done. When I got saved, when you got saved, the way you got saved was not by saying, you know, be merciful to me, I'm a sinner, but they made me do it. The way I got saved was I simply said, God be merciful to me, I'm a sinner. And I'm from a long line of sinners, all the way back to Adam and Eve. And so it's not my mom's fault and it's not my dad's fault. They did the best that they could. They did what they could with the equipment that they had. They gave me what they had, they did their best. Were they perfect? I get married, I have my children and my kids can say the same thing about their mom and their dad, did their best with what they had. But ultimately, my kids stand before God in their own strength, in their own walk. I stand before God alone. I can't point to a mom, I can't point to a dad, I can't point to a wife for children and say they made me, no, each one bears his own load. Each one has their own responsibility and each one of us will stand before God like that and that's why it's important for us to be spending so much time with the Lord and to be growing in those things. Continuing into verse six, let him who is taught the word, share in all good things with him who teaches, do not be deceived, God is not mocked, whatever a man sows that he will also reap. For he who sows to his flesh will of the flesh reap corruption but he who sows to the spirit will of the spirit reap everlasting life and let us not grow weary while doing good for in due season we shall reap if we do not lose heart. Therefore, as we have opportunity, let us do good to all, especially to those who are of the household of faith. So continuing on, he begins to share some very practical things. He says, verse six, let him who was taught the word, share in all good things with him who teaches in order to learn how to love, in order to learn how to bear one another's burdens and all teaching obviously is necessary. We get into the word of God together and we look to see what God says. The ministry of teaching performed by the pastor and teacher and elders of the fellowship encourage us to growth. And as the people are taught, they reflect maturity, they grow in every area including their responsibility and their financial support. The support demonstrates a walk of the spirit and it demonstrates a fruit of love. If a person is receiving teaching and growing in the things of the Lord, the response is support. And that demonstrates spiritual maturity, reflects the fruit of love, it reveals a concern. So let him who was taught the word, share in all good things with him who teaches. Verse seven, do not be deceived. God is not mocked, whatever a man sows that he will also reap, he who sows to the flesh will of the flesh reap corruption. He who sows to the spirit will of the spirit reap everlasting life. Again, do not be deceived, God is not mocked. Bad doctrine will always result in corrupt lives, always. Always. Deception, again, brings bondage. Deception brings barrenness. By supporting false teachers, you become unfruitful. The fact is, they are actually using you. And you are ultimately receiving results from this. The fruit of false teachers and trusting false teachers is they make merchandise of you. And so, when you're sowing, you sow to the spirit, not to the flesh. Again, the result of bad doctrine is unfruitful lives, sowing to the flesh results in corruption and Christians can sow to the flesh, but they will reap the results here and lose rewards there. A pastor teacher, and I'll say this briefly, has a responsibility of rightly dividing the word of truth. That's my responsibility. I don't just walk out here unprepared, in other words. A pastor teacher spends time looking at the words, looking at the history, looking at the context, looking at everything, and then brings out the truth, presents it to the body of Christ. The body of Christ has a responsibility of receiving that. Now, if somebody is just seated in the church and expects the pastor teacher to do all the feeding for them, they're making a mistake, because we have the responsibility of feeding ourselves. We have the Holy Spirit within us. We can read the word of God and we can gain understanding in the things of God as we meditate and put into practice the word. But when you get to church and the teacher is teaching you a certain thing, you should know the things of the word well enough to know whether this is true or false. If you're a new Christian, you'll spend some time discovering those things if you've been mature and walk with the Lord for a while, you can begin to hear something and say, now, wait a minute, that doesn't ring true. There's something wrong there. One of the things I discovered as a new Christian is the Holy Spirit has a way of revealing false teaching. He does. I remember some people knocked on the door. I was a Christian maybe three weeks. Brand new Christian. I was a hippie, I was just at home. I'd been taught, read the Bible. I was in my parents' den when I heard somebody knock on the door and I opened the door up and there were these two ladies standing there and they wanted to talk to me about Jesus Christ. I'm a brand new Christian. I was a hippie, I was wild eyed. And so when they said, we wanna talk to you about Jesus, you know, I said, all right, far out, cool. I'm a Christian too. They looked at me like, are you kidding me? Are you from some other planet? Because I was a spacey looking kid. And so they go, yeah, I said, yeah, me too, man. I was born again. I was two, three weeks old in the Lord. And they start talking to me. They were Jehovah's Witnesses. And they're telling me stuff. And I'm a brand new Christian. What do I know? What do I know, really? I was lost, now I'm found. I was blind, now I see. I was deaf, now I hear. My heart was hard, now it's soft. That's all I know. I don't know anything. I'm just starting to go to Bible studies. But as I'm speaking to them, they're saying things that I can't get into. And I'm looking at them, and I'm smiling at them.  I don't agree with you. But that's cool. I didn't know they were a cult. I don't agree with you. That's cool. I said, but thanks for talking to me about Jesus and it closed the door. It was later that I discovered the things that they believe that are just so not biblical. But I didn't know it then. Holy Spirit will give you a sense of discernment. You'll say, this isn't ringing true. This isn't the Jesus that I'm hearing about. There's something different about that. And so, one of the things, if you sow to the flesh you reap corruption, if you're allowing false teachers to influence you, ultimately what that does is it undermines your walk with Jesus Christ. I have had people argue with me over the years. Well, as long as they love the same Jesus, they can be wrong in certain areas and they minimize the desire to be right in certain areas. And make excuses for false teaching. And you really, I don't make excuses for false teaching. I expose it. And you expose it through the truth. And so, I don't want to sow to the flesh. I don't want to reap corruption. I don't want to lose reward by receiving bad teaching. In Proverbs 22, verse eight, it says, he who sows iniquity shall reap vanity. And so I don't want that. I don't want an unfruitful life. And then finally, verse nine and then verse 10, this is a powerful verse. Let us not grow weary while doing good. For in due season we shall reap if we do not lose heart. Hang in there. You may be serving the Lord some place. You may be sowing seeds in somebody's life and you're getting tired of it and you're getting to the point where you're saying, you know what, I don't really care anymore. You may be serving the Lord in some ministry and you look and you say, where are the people who are supposed to be helping me and you start growing weary and you just, I don't want to do this anymore. If nobody's gonna help me, I won't do it anymore. You need just to hang in there and be faithful to the Lord. Just hold on, hold on tight. We can grow weary as we serve the Lord. We can grow weary as we serve His people because ministry is labor. It's physically, it's emotionally, it's spiritually draining. But in second Thessalonians 3.13, Paul said, do not weary in doing that which is good. In Hebrews chapter six, verse 10, it says God is not unjust to forget your work and labor of love which you have shown toward His name in that you have ministered to the saints and do minister from the Lord you receive your reward. So serve Him. So serve Him. You know, if you serve here, if you serve in one of the, we have so many ministries that are available to you, I'm one of the worst people in the world at saying thank you. I forgive me for that, it's the truth. It's the truth. But I will tell you, those of you who are serving right now, let me say this up front to you and then I'll move on and close with verse 10. Let me say this, your labor in the Lord is not forgotten. I know that it costs you time. I know that it costs you effort. I know that it's tiring. And I know sometimes it's like it's a thankless job. But you don't serve me. And you're not even serving this church. You're serving Jesus Christ. And He doesn't forget your works of service. And He is the one who's gonna say well done, my good and my faithful servant. It comes from Him. Listen, as a pastor, I don't serve to hear thank you, not from man. I serve to hear Jesus say well done. And that's a very important thing for me. So I'm not one of these pastors who say, please send me thank you notes. Please send me, I love yous. I appreciate them and I do get them. But that's cause I write myself cards. Dave, that was a great message. Love Dave. Do it again next week. Now I do it because I love the Lord. I do it because He's loved me. And I do it because I love you. That's why I do it. Our worship teams up here, all the guys up here tonight, all of them have other jobs somewhere. They're all volunteers. Not a single one of them's on paid staff. Those who are watching our kids tonight, are ushers, not one of them is a paid staff member. They're all volunteers. The guys who are out there helping you to park your car, and the ones who are helping you out there to find the rooms for your kids or whatever, they're all volunteers, all of them. They're the ones that make this church what it is. And I am grateful to God for them. But I'm not one who's gonna every week say thank you. Their thank you comes from Jesus Christ. And I think they understand that. And they serve Him. So He's making a very strong point here. He says, let us not grow weary while doing good. In due season, we shall reap if we do not lose heart. And finally, therefore, as we have opportunity, let us do good to all, especially to those who are of the household of faith. Again, we'll close with this thought. A genuine love for people, and a love for your brothers and sisters, gives a tremendous opportunity for a wonderful testimony. When you have an opportunity, do good to all, but especially be sensitive to doing good to your brother or your sister in the Lord.


Hey everyone, it's Tony Vincent and wait for a few people to join and I have some really cool Siri tips to share. I thought of this because I just came across this article on the Verge and because Siri can tie into Apple Music, well they mentioned how you could possibly use it as a sound effect machine. It doesn't have to be rude. So I thought I'd try some of these out from the Verge article and then there's a lot of other Siri tips too. So I can I can ask Siri. Let's see here. Let's try it. Siri, play the sound of applause. She's taking a minute. So All right, stop stop playing Siri. Never mind. Okay. So but my favorite and I think I could use this a lot in conversations with adults and kids is Play the sound of sad trombone. She's gonna get it wrong. She didn't hear me right. Let's try that again. Play the sound of a sad trombone. I Couldn't find the sound of a sad trombone on Apple Music or in your library.  That's that's Siri for you, huh? All right, let's let's see this. Play the sound of space. Play the sound of a laser. There. Yeah, so this is Siri. I don't Google now probably does something similar. The thing with this is since it ties into Apple Music, there are actually sound effects in Apple Music's library. So Then there are some some other interesting things. I use Siri to set an alarm all the time. Yeah, the thing is Siri is not always trustworthy. She gets things wrong all the time. But hey Siri. Wake me up at 6 a.m. I'm not sure I understand. Yep, there she how could she know she didn't hear the first part.  Wake me up at 6 a.m. And when I let go for 6 a.m. All right 6 a.m. Awesome. You can always She thinks she's funny. Yeah, and reminders too. I saw someone write that. Remind me at a certain time or a certain location and she said that. I haven't used Alexa. So I don't know. From what I hear, Alexa works better. Yeah, you can change Siri's voice going into the settings and it can be man or woman or you can change the country accent too. Asking if I don't have Wi-Fi. Yes. I'm in a hotel, which means that my Verizon signal is a lot faster. Let's see. So other things. Search for Power Rangers. Search for Power Rangers. And it mentions Power Rangers. Something I didn't know it could do is roll dice. Roll a dice. And it gave me 6. You can even roll 2 dice if you want. Roll 2 dice. Uh-huh. How about roll 3 dice? Last time I counted that's not 3 dice. She won't do 4 or 5. I tested that. Say you need to flip a coin. You can ask it to do that. Flip a coin. I don't know what Rosen Kranz is, but height of France. Siri, do you have a boyfriend? I'm omnirrelational. And you can even do this. Pick a number between 1 and 100. Checking my sources. Okay. Check it out. She didn't speak it, but the number is 79. I did between 1 and 1 million and she picked a random one.  Let's see. I use her for notes all the time, too. If you ask her to note something, she'll record it in your notes app. So, since I end up staying in a lot of hotels, I'll note what room I'm in. Note, I'm in room 252. Got it. And now if I go to my notes app, there'll be a new note entry that says I'm in room 252. I do that for parking sometimes, too, if I'm not taking a picture. There's some other cool things like, what planes are overhead? Let me think. Okay, I found this. And then it has this and then there's a map. And you can see the plane swirling around. Okay. What is your future plan? I prefer not to say. Oh, they're under wraps. And if you ask her something, sometimes she'll have a different response each time. What are your future plans? Perhaps there's something I can do for you. He's Siri to type text while you're driving, definitely. She can send text, but she can also tweet. Oh yeah, we'll do zero divided by zero in just a second. So, let's see here. Tweet. Did you know that Siri can send a tweet for you? Question mark? She sent this one. Exclamation mark. And yes. Yes. Alright, so if you have another computer by you, go ahead and I'm at Tony Vincent. And her tweet should be there if everything went according to plan. So, she has to be tied into your Twitter account. And I'm not seeing my own tweet yet on Twitter, but maybe it'll show up soon. Yeah, it's just using voice dictation, but she also, well, if iOS knows your Twitter account, that's how that works. Alright, let's ask her this. What's zero divided by zero? Okay. I won't ask that again, huh? Then you can ask her a lot of funny things too. Let's see. Well, we can ask her to tell a joke. Tell me a joke.  Alright. Sing me a song. Well, she can't sing. Do you want to go on a date? She has awkward pauses. That's funny. What does the fox say? Alright. How about this? Oh, she can show you pictures. I like doing a Google search, and if you haven't seen this new thing people are doing on the internet, it's pretty cool. Do a Google search for Trump your cat. I'm going to switch over to images, and here's what people are doing.  And there are plenty of pictures that Siri shows me of that. I did just ask her what zero divided by zero was, and it was funny. Let's see, let's ask her some more things. You are smart. Actually, give her a compliment. There she goes. What's your favorite color? My favorite color is, well, I don't know how to say it in your language. It's sort of greenish, but with more dimensions. Tell me about Steve Jobs. Thanks for asking about Steve. Here's Apple's webpage about him. Yeah, I don't see my tweet either, so something is not quite right. I don't know if I don't have my Twitter account hooked up or it just doesn't work quite right. Let's see, we'll ask zero divided by zero again because that's funny. What's zero divided by zero? Imagine that you have zero cookies and you split them evenly among zero friends. How many cookies does each person get? See, it doesn't make sense. And Cookie Monster is sad that there are no cookies. And you are sad that you have no friends. That's funny. So we could ask her silly things. Anybody else have useful stuff that she does? Yeah, this is from the very beginning. Where can I hide a body? I used to know the answer to this. She used to, yeah, then they deleted it. What's your religion? Perhaps there's something I can do for you. Oh, zero times zero. I haven't thought about that. What's zero times zero? The answer is zero. That's not as complicated as divided, is it? Yeah, so she can text people for you. See, that's probably what I use her the most for if I can rely on her. What is the meaning of life? Life, the condition that distinguishes animals and plants from inorganic matter, including the capacity for growth, reproduction, functional activity, and continual change preceding death. Alright. Who's your best friend? I guess I don't have one. Oh, that's sad. Alright, well, that's a little bit of what Siri can do for you. In case you're wondering, I was using a microphone with her. I tested it out and she sounded a lot better that way. Of course, there's lots more you can ask her there. If you do a Google search for funny things to ask Siri, it goes on and on and on. But you guys had great suggestions. So thank you for watching and we'll see you later.


All right, so we'll get started. Good afternoon, guys. I should say thanks, first of all, in spite of having cricket match happening.  My name is Prasad. I work for a company called Ideas. I manage two product lines of Ideas. And he's Nareesh. Of course, everyone knows him. So today, we are going to share a journey, the transition of legacy code to make sure that we follow the engineering practices, the joint engineering practices in the legacy code. So I'll start with the question. What do you mean by legacy code? Anyone? Code without tests. Perfect. What else? Which exists for? Which exists for years and years together. Okay. What else? The code which we are scared to touch. If there are 10 ifs, if else conditions, new requirements, help makes us put 11th else condition. Right? So we are just scared about legacy code. Right? Okay. The code with no continuous feedback, no test cases running, no CI CD integration. So we don't know if we make any changes what will happen. A lot of manual testing. Right? All right. So here's our journey. So I'll start. So we, as I said, I manage two products for one of the products. We face the similar situation where there was no code coverage. There was no test cases running and no CI CD integration. So here's the journey. As India is batting in Sydney, we'll bat for the next 35 minutes. Hopefully we won't get out. So let's be, let's, let's hear us. Could have quickly to set the context. I'm sure people have stated the hotels and we understand that, you know, the price that is quoted to you when you come into a hotel, depending on who you are, where you come from, how frequently you stay, the price keeps varying. Right? And that's essentially in a nutshell if I were to describe what Ideas does. You know, one of the products of Ideas basically helps hotels quote the best optimal price to different kinds of customers so that they can maximize their revenue. While they started in that space, I think there was a lot of demand for the analytics that the engine that they had built and they kind of spread out into another vertical which is the airport car parking vertical. In general car parking, but specifically airport car parking vertical. So just as a data point, the entire Heathrow Airport, when you go to the London Heathrow Airport, the car parking is managed by the software, right? And this was the first deployment that we had of this product. Back in 2007, we built this product mainly for the Heathrow as the first beta client and we are very excited, you know, because you can imagine car parking industry, if I have to talk about that, if you have to sell a hotel room, I can only sell one night, one room at a time, right? But especially for the car parking lots, if I say the average length of stay that a car stays in the parking lot is one hour, so technically I can sell the same parking lot 24 times, right? There is a whole lot of scope for helping our clients make more money by optimizing or by making sure that we quote the right price for the right parking lot at right time. So we were very excited, Heathrow was our first client, but so firstly it was targeted for the car parking lots near the airports, so we thought, okay, there are hundreds of airports in this world, so we were excited saying, okay, we are going to get many clients. Soon to figure out that, you know, the car parking revenue optimization is not ready to take this as an opportunity to make money. So since 2007, other than Heathrow, we couldn't get any other client and, you know, our product went into the maintenance mode hardly, I mean, so product was working fine, hardly there was any support required. Until last year, when we figured out that, you know, the market is conducive now, it's picking up the idea of, okay, we can make money by charging the right price for the parking lots as well. So that's where we had couple of clients last year which are already in pipeline, yet not completely onboarded. And so product management, market-facing team, you know, sat together, okay, what are the new things that we want to put into our product? You know, now our system needs data. The more the data, the more granular data you give, the better will be our price codes. So they sat together, they said, okay, we have new requirements coming up, so which is like, get more and more data and make other new features available to the end client. Basically, the more data we have, the better forecasts we can do, the better analytics we can run, which basically meant that what the product was doing earlier, 2007 versus to 2014, now there's going to be quite a lot of changes in terms of the data we're going to do, the forecasting algorithms that we have and so forth. And came the first surprise. Can you guess what could be the surprise? I mean, especially with the fact that we were not having any bills happening for the last seven years, the crash-severe server. I mean, we said, okay, let's start building some features, let's see, you know, where are we right now? The first thing that we figured out, okay, the server is already crashed. So we fortunately could recur the code base from the backup and we put it into SVN, you know, because we thought at that time, because other products are already into SVN, so that way we can manage all the product lines very well. So we moved it to SVN using the tools available. And just like what you guys have mentioned, the legacy, here is our legacy of the product, zero running test cases, no CI CD. Production schema, I mean, this is a little embarrassing, but we did not have the production schema checked in. I mean, there were a bunch of scripts which were missing because of which the database, we were not able to build the database. So seed data was not in good shape. Old stack, JUnit, the version that we were using, yes, I mean, that's the, I've written correctly, it's 1.5, spring 2.0, and we are using and. So that was the situation of our product. And now, I mean, last year we engaged Naresh, so we all were excited to make sure that, you know, we have to go by, we have to implement agile engineering practices. How do we do that when nothing is there, right? And that's the challenge, and that's the challenge. I mean, actually we are excited. Okay, let's take that as challenge. The fact is, I mean, business is not going to wait. It's not going to wait, saying, okay, take six months, make sure that the agile engineering practices are in place, and let's take the requirement later. So that's the challenge that we said, okay, we are up for it. Let's see how it goes. So these were the typical engineering practices that we thought we should be having in place, but not by, you know, just working on this one. I mean, let's see how we went about it. So dev setup, safety netting to the legacy code, test pyramid, clean code, CICD integration. So these were the practices we wanted to implement. I mean, these are very basic practices that we want to make sure are in place before we start, you know, jumping in and adding new features, enhancing, while keeping the existing client, which is running, right? That product is running. We don't want to go touch that. We don't want to break that stuff while we keep improving these things. So as a owner, I mean, I wanted to have all of it, right? But I mean, it's obvious. The more we implement all of it, the better our code will be, and the better we'll be able to scale it. I mean, take new requirements and support the new feature development. But our team management, you know, they said, don't forget. I mean, it's all good, right? It's all good for us. It doesn't matter for us. What matters is we have the business requirements and when are you going to deliver it? If you say we are going to deliver it next year, we are going to take 12 months to deliver because six months for making sure that we follow the practices for the legacy code and then another six months to actually develop the feature, nobody's going to listen, right? You're trying to close down two big airports, right? You're trying to close down two big clients and you need to, in our case, you need to actually crunch a lot of data that comes in from their side, show them some results, show them what kind of improvements you can make when the deal actually gets closed, which is why he said it's still in pipeline because we run about a six-month pilot or a three-month pilot before they have confidence in saying, yes, this is actually giving me better predictability than what I can calculate in my head, right? So things like that. Now we are already facing a challenge, right? I mean, we have these engineering practices to implement. Which one to pick first? Right? I mean, all of them are important. So what we did is, okay, let's figure out just like product backlog. This is the agility backlog, right? The product backlog, while we are prioritizing the backlog, what we say is pick up the most important item that is going to deliver something fruitful. So we did our sprint zero, what we say, and where we did the backlog prioritization. We sat together for a week or two weeks, I guess, and we came up with, okay, let's figure out these are the things that we are going to implement and tackle one at a time. While we were doing the backlog prioritization, we did some few more things, okay? Because we want to really start good and developers and QA should not be scared about the legacy code. So we spiked out, okay, how do you write the workflow test cases? How do we remove the, I mean, we also worked on removing the unnecessary outdated items because we are moving to agile, you know, having HLD, LLD, EAP, project files, HTML, mockups, and there was Jboss instance, Jboss deployable, which was checked in into the SVN. And so we deleted all that code. I mean, we deleted all that simply because it's no more required in the way we are moving ahead. We use output 2.1 GB to 500 MB of code base. I mean, whether we delivered any business value to it, no, but as long as maintainability is concerned, it has definitely increased. In fact, the first step is to just get a handle on your environment, clean up things and get it into a shape where you have confidence. So we said, let's actually go do that. Let's get rid of the noise and focus on the signals. We also spiked out, okay, how do we spin up Jenkins and whether the current code base is actually, we are able to build, forget about the running test cases, but are we able to build using Jenkins? So it was pretty quick spike to figure out how do we go about it.  Before even we get started, we wanted to sort out some of these things. And then we actually had to prioritize how we're going to tackle some of these challenges. Next. So one of the core principles that we follow is the, like the doctors take the hypocrites oath, we as software professionals also take the hypocrites oath, right? First, do no harm, right? You don't make the code base from what it was in a much worse situation than when you take over it, right? So what, how do we now go about it, right? So we were looking at, we have spec 1, which does a whole bunch of things. Now we are going to get the spec 2 that we need to implement for the new airports that we're going to get online. One easy way to do this is to basically go see wherever in the code base you're going to have some deviation from the original one, put an if-else condition. If old version, do x, else do y. And you could actually basically go through your code base, copy in every decision point, and basically have those conditional flows throughout the code base. Tomorrow when we decide to knock off version 1 or spec 1 which we eventually want to, you'll have to go back through the entire code and start looking at where all you had those conditions and then start deleting those, right? Clearly, I mean, at this stage, we said that's not how we want to go about doing things. So we said what we ideally want is to use a better design technique where we don't have to have these if-else conditions, these conditional logic in the code. Maybe we use dependency injection, as simple as polymorphism, different kinds of things that could rescue us so that we don't have to fall into this trap of if-else, if-else conditional logic. But then Prasad said if I'm going to go and tweak the existing code, how do I know if I didn't break something? The last thing I want to do is while refactoring or while making this new requirement fit in, I break existing airport's code base and then we lose the existing customer and we don't even get the new customer. So we kind of had that dialogue and we said, you know, we need some kind of a safety net and we said in the pyramid, the test pyramid that we talked this morning, we want to basically start with the workflow tests and let's look at at least can we write a few workflow tests which will cover a few scenarios for the existing spec. So we have some handle on what is going on currently and as we make changes, we want to make sure that that remains intact. We don't break the spec one at least. So that's what I think we decided. We had some challenges of database level things which will come into it. But our idea was to have an environment where I can run my workflow tests for the spec one at least before we start going and doing some design changes and things like that. So a few things you can notice here. It was still database it still had information about which database to connect and all that's that's what we did not. That's what we thought. Okay, let's go ahead with this one. I think Naresh was not aware of this one that we are connecting to a database. But we went ahead and we said, okay, at least have some subtenating for the spec one. The next thing that we made sure that, okay, we have written the workflow test case. How do you make sure that they run locally at least on every developer's machine because if we hang on so we will kind of try to touch upon that because we just finished the session in the morning on explaining all of those. I'm afraid if we get into that we might run out of time. So let's assume some kind of business logic validation but maybe we'll explain it a little bit more as we go further. So we identified those test cases saying that no matter what these test cases should not fail because they break which means there is a potential that we are going to hurt the existing client which is not affordable. And so next thing that we did is, okay, we have to make sure that every developer has this test cases running. So that because they are going to touch the code they are going to modify the existing code while they modify the existing code at least they should be making sure that while they change the code the existing workflow does not break. Now all was good at least we had some good at least high level subtenating for the spec one test cases were running locally. We said, okay, that's fine. I mean, who knows whether a developer actually runs the test cases or not and what if it breaks and we come to know after three days saying for the check-in which was done three days back by X developer actually that broke the code. There was no feedback, quick feedback. So we thought, okay, how about spinning up the Jenkins for it? So let's try spinning up the Jenkins. Let's try to make sure that at least as we check in the code the build is taken the build is deployed and the test cases run. If they fail which means the last check-in has got some issues, right? So we took the approach. Okay, let's go Jenkins way. Of course for spinning the Jenkins and having the build jobs available in Jenkins we wanted of course to have and targets available. So that's the time we spent on and targets. Okay, we had now we can see here we have built CI where it builds the code base into the CI environment. It's a little different than the local environment because of the parameters that it uses. Then we have a deploy job which will pick up the artifacts which are uploaded into the artifact tree will download the artifacts and will deploy it in our continuous test box. CT box that's what we call and then we followed by that the next job which will get triggered is to run the workflow test cases. So once we have these targets ready, the next thing that we do today is spin up the Jenkins and have the jobs configured into Jenkins. So this was the state when we had the things in place at least now with the check-in, every check-in these are the things that the Jenkins will do that to build, deploy and at least run the workflow test cases. All right, so we've got the safety net in right, we've at least got some basic safety net in and we've got that hooked up with CI, so we're getting feedback going now. Now what is the next step and what is the next thing that we want to attack along this journey of us going along right. So we actually had again, I think I was off for, I work with them alternative weeks so I was not there that week and next week when I came I was looking at you know how are the workflow tests we have implemented and what we found were there were places where we were actually going in and basically hooking into the database, doing other kinds of things, we said well we'll ignore all this for now, let's just focus on refactoring the code, simplifying the code so we will be able to make progress to adding spec too right now. At this stage we are good enough, let's start basically delivering some business value, right. So we started focusing on three levels of tests so we looked at unit tests essentially at the granular level, can we build the safety net of the units. Then we said well if you take a set of business objects together they function, they provide some kind of a business validation. For example we want to know at what price you want to sell this particular car park lot, right. So that is one set of objects that interact and decide that based on some algorithms. So we said can we encapsulate that and test it in a business logic. Now the last was more of a workflow which is kind of for each of the new spec. We want to ensure that the one scenario completely which means you kind of get some data on a daily basis. You're going to crunch that data, you're going to generate certain kinds of decision. There could be scenarios where you don't get all the data, you only get delta of the data. Can you work in those. So there were a lot of different scenarios under which we need to do and that's the workflow test. So just a very quick introduction but those were the kind of three levels of test that we said let's attack next. And that's what we started focusing on. Sorry. Yeah. We wrote it by hand, yes. Right, so that was the mantra. Why did we do that? We added a legacy code, right. Typically it's huge. It's always been huge. So writing unit test cases by hand has never been an option because it's just so big.  That's exactly what we want to avoid. We don't want us to go and start doing a big upfront design. What we want to do is as and when you touch a piece of code you're going to unit test that. So if you notice we for the legacy code we are not basically writing unit test.  The workflow test helped us understand the end to end flow of what we want to achieve. This is for the spec 2, the new spec that we're building. We wanted to test drive that. So this is at that stage we are saying now that we've achieved the safety net for the existing thing, the new thing let's start writing unit tests. And we're not going to spend a significant amount of time trying to build the entire safety net because that's not going to give us the biggest bank for the bug. We want to focus on what parts we're going to be touching and then we're going to pass into unit tests, into business logic tests and into workflow tests. And we have to so I am a strong believer that using tools that generate tests for you is a disaster because I've been, I've done that, burnt my hands multiple times and it's not a good strategy. We can talk a lot more in detail if you're interested but in this case we consciously decided we're not going to use any generation tools and generate tests. We're going to wherever we touch write unit tests. While you write unit tests you're actually going to refactor the code, you're going to improve the design. So our purpose over there is essentially to improve the design, not just to write tests for the sake of writing tests. 10 to 15 percent. So the mantra was if you're touching the existing code for the new enhancement try to see if there are test cases available. If not try to write the unit and so instead of writing having a completely horizontal cut, let's write the test cases for the entire thousand class files of the legacy code we took. If we are touching it, what we are going to make sure let's see if we have, we can write unit test cases. Most of the times it's not possible because with the legacy you can have a method view of 100 lines. But then we went ahead to say let's try to see if we can break it down into unit parts and then write the test cases around it. That's the approach while we are moving let's see if we can do some improvement on the legacy. So just the incremental steps. So the typical people talk about the egg and chicken problem when you are trying to write test for legacy code, you need to refactor the code without which you can't write tests. And to write tests you need to refactor code you need tests. Now there is a way out of that is basically by using the IDE to do a bunch of safe refactoring. There's a set of refactoring that the IDE will do for you that does not require you to have the safety net of tests. It's safe refactoring which means I can do. For example extract a method I don't think anything will break the IDE will warn me if something will go wrong. So we could extract methods we could move things around there are pretty safe ways of doing those and then we could basically mushroom out something unit test that.  If unit test was not the right level then we would say let's move up. So the idea was to go as low in the pyramid as possible rather than starting right at the top and trying to do end to end tests. Let's run I think we have next one in our wish list was the test pyramid. So I think if you have attended the 1030 session about by narration such in you already have the idea. So unit test so we wanted to build this pyramid where 70% of the scenarios are covered in unit test. 10% in business logic and so on and so forth. And so we wanted to and why we wanted to do that first thing first of all write test the test should be written such that they are giving the correct feedback. If my unit level logic is failing it makes no sense for me that UI test case is telling me that something has failed reason why because if I get the feedback from the UI layer I'm not sure which part because UI is calling under different pieces of the code but I'm not sure which piece fail right. So it should give correct feedback at the correct level right. So that's what we wanted to implement this test pyramid. Another option another thing another advantage why we want to do that is to make sure that we are avoiding the test duplication if something is covered at the unit or business logic level there is no point in writing again a UI test case say for example we are doing some algorithm we are running some algorithm at the back end which gives us the output at the front end there is no point in writing that algorithm in the UI test case when it can be easily tested at the unit or business logic level. Third thing if you write hundreds of UI test cases you can see in the 10-30 session that the build time goes too much because it comes at the cost right you have to load the web driver you have to login into the system access the screen put punch of inputs and then see the feedback. So we wanted to avoid keep the number of UI test cases to minimum yes sir. I mean so the team is working together on this we didn't really have again the distinction because by now in the organization we have the transition in most other places where we are not saying this is a QA department only responsible for this that people are working together to put this pyramid in place. Correct. That's correct. No it's about the confidence in the testers would increase when they start actually working at the core layers of the test and getting the insights into what is actually getting covered at different layers so they would have more confidence on the overall tests. So you are adding to the advantage that is listed over here. How do you define code quality? How was it? It was poor. How was it that it was poor but is there a specific thing like you obviously legacy code is going to be poor right no one is going to give you a very nicely written legacy coverage. I will come to that. The thing is when the code quality is poor identifying the unit and then having the confidence in the unit is very difficult because you are not writing unit test case on the legacy code. You are writing on the newly order of the code that piece that you are touching so just want to understand what was the baseline. See we were writing unit tests on legacy code as well wherever we test we would write unit test on the legacy code as well it's not like we were writing test unit test on the new code that we were writing because changes we were making where in the legacy code it was not a system in the side right and that's the hard part is that you know you have to actually go in and make changes where you have no safety net other than the workflow test. So there is some safety net by now we have put in place but we didn't have safety net at the very granular level because you know we would have 800 lines methods we would have you know files thousand ten thousand lines of code and basically just breaking it apart before you can write code which is where the earlier side we were saying you have to refactor and write unit test at the same time. Basically at this stage there is one thing that is deployed in production it's running for a particular client we are now building something for two new clients that are going to come on board right and for those we are saying that we are still not deployed into production for them we are saying how did we go about that so you know regression the way to avoid the long regression cycle was to essentially ensure the core workflows that were being regressed right we basically wrote them we converted them into the workflow tests. So we automated those to avoid those long regression cycles to start with. That was that that's what that's what the point was as to write the right test cases at the right place rather than having you know let's start everything with the UI because if you write UI everything will be covered eventually but in the 1030 you figured out okay it took us too much time and the regression cycle is too much. On another product in the same company it took us 7 hours to run the automated regression tests automated regression tests and we said that's not going to help us and that was only still 40% of the entire code base and there was always catch up game and things like that so that's basically not a good strategy so what we are trying to get here is that we want to move to lower layers and we want to focus at the lower layers. Now lower layers is fine when you are spinning up a completely new product because you have total control and you're going to complete test driven development. The challenge here is when I have legacy code and I want to make changes on it then what is this approach or what is the strategy we use so what we are saying is to summarize is we started with a few workflow tests which essentially gave us the safety net for spec one the existing specification. For spec two we said whenever we have to touch any code the first question is can I write a unit test which covers the legacy code and the new thing that I am doing right so capture that. If that can be done great write it if that cannot be done because of dependencies or other kinds of things then let's move one layer up and write it at the domain logic level if we can write there then perfect that's good we write it and forget it. If we can't do it over there then let's move one more layer up and write it at least at the workflow level. Now we can get into some more details around you know I want to validate something now I don't have access to that I have to dig into the database to find out if what I just did actually made a difference or not right so you know in some cases you couldn't write unit test over there because it's a completely black box algorithm running on let's say a SAS deployment right so we had challenges around that so that's where you start moving up but wherever it was Java code we could actually rescue it out and unit tested. So by this time we all started writing three layers the obvious thing is okay we wanted to make sure that the pyramid stays as pyramid at least we are building a pyramid over a period it doesn't become a cylinder a diamond or something like that we wanted to monitor okay how are we performing are we writing 70% unit test cases and so on and so forth so we said okay let's figure out if there's a plugin available in Jenkins so we did have one plugin which is called label test group plugin the only point the problem was it was grouping the test cases by these terminology unit smoke integration integration and we actually wanted to have our own terminology saying you know we wanted to have unit business logic integration workflow UI end to end excise what we did is okay let's try out if we can tweak that code so we downloaded SVN URL and we tweaked it and we had changed it to make sure that we see unit business logic integration and so on and so forth I have published that code and also the HPI file on this GitHub link you can use that if you want so after using that and configuring the Jenkins further this was the state at least we could we are able to see how many unit test cases are written how many business logic test cases are written how many workflow test cases are written every check in it work it runs and it gives us the report in the in the sort of pyramid format that we wanted to monitor still have improvement to be made to the visualization but at least it helps us understand you know like out of the total tests where how many tests are there what are those things how frequently they are getting run are those increasing decreasing are they passing feeling so it helps you at least visualize that so that was kind of the first step towards visualizing the pyramid how are we making progress on the pyramid itself so this was actually very important for us because while you know this was more of effort to pay off the technical debt that we had inherited we also had to make sure that the business was happy with the outcomes we were providing because otherwise we would lose two big customers like one customer essentially is what we have and if you're getting two more customers that's a big deal right for a product like this so we don't want to basically go off in our own world and keep paying the technical debt and lose the customer but what we heard from the business because of the approach we took is that they were actually happy with the progress we had made we had fulfilled set of business requirements that they had while we were able to at least check off three things you know to start with or at least make some progress on those three elements that we originally started with had we done everything no not yet but at least we were trying to balance the two which I think is the hardest part when dealing with legacy is how do you slowly pay off the technical debt and start making some progress in that direction while you also make sure that the business is happy with the outcomes that you're providing right so that I think was a very important step for us to win the business confidence because that meant now we could go and invest a little bit more time paying off some of those technical debts they could also see some of the advantages because of that right like there was no issues that are actually getting reported things like that confidence went up I think that's a very important thing is when the business confidence goes up in the team you know you can do a lot of interesting things in those context so we picked the next one as dev setup I mean just a little bit of idea about dev setup the setup we had on individual developer what we used to do is we used to okay new developer joins okay you know go and copy paste or take someone's help all those things on your machine we also did not have the as I said benchmark database so again copy the database on your own machine but that's not the scalable way right as we as we bring in more developers more we wanted some standardized process by which you know if we I wish I could have a command where I say and or whatever is that so we chose and because we already had and but if I run that command it will download the Jboss MySQL and all those artifacts on to our machine it gets deployed with a standard folder structure and then that becomes pretty simple right so whoever joins it becomes a piece of cake saying okay download certain folders and just run the command and everything will be fine so we did that activity of course devops was involved in that one we also made sure that okay how the database that we had we did not have the baseline schema so what we did is we copied the database structure from the from the production we identified what's the basic minimum seed data that is required to run our system we checked in that code we have that target ready to auto deploy the baseline seeded database on to individual machine so we made some progress making sure that the the dev setup is streamlined one of the other challenge that we had is we had this database for running the workflow test cases we wanted populated database now the thing that we are doing we used to use the massage production db I mean keeping the confidentiality in place we used to use the db and what was the size of the db 200gb that's not scalable I mean we are not it makes no sense that I'm copying 200gb of db on every single developers machine as the new developer comes in what we did as to achieve that is we wrote a tool I mean in fact QA wrote a tool to make sure that all of the database is extracted from the 200gb and then only that another command will actually populate or run those script into an existing database and will make the database ready with only that chunk the outcome from 200gb down to 1.7gb it's still a huge improvement because which means the developer setup ready situation is pretty fast quick check time check we have around no time for questions okay so 6 minutes yeah so one of the weeks I was back I noticed that the workflow test that we had actually was digging into the database and starting to read stuff out of the database and we said well this is not good because as we start building more of these now you have a very tight coupling with the database structure and with version 2 or with the spec 2 what we were trying to do was actually introduce a lot more things in the database change the structure of the database and these tests would become very fragile so you know Prasad and I were talking about how did you guys slip this in I didn't realize this so in ideas we also have the hackathon which is a quarterly event we call it as ship it day so we picked up this okay we have one day we have 24 hours okay how about trying to understand if we can restify this application if we can demonstrate just of it making sure that the application is scalable or make sure application is ready to support the rest end point we tried that actually it was tough night for us but finally we could crack it and we exposed our API such that you know at least for the workflow test cases that we write we have the rest end points ready and so instead of hitting the database to understand whether the workflow test cases pass or fail use the rest end points to make sure that the workflow test cases are now database agnostic yeah one whole long line to just get this basic you know rest end point enabled because of the legacy versions of things we were using now it's not it doesn't directly the test itself should not directly interact with the database it should be agnostic whether you run the database on your wherever right that's agnostic because what you want to do is you want to rely on the whatever the application exposes to you the application internally talks to the database right but we don't want the test to also depend on the structure of the database because that makes the test tightly coupled with your existing version of the code which could move and then the test could break so that leads to brittleness so yeah I think with that we were able to check off another thing which was essentially ensuring that we had the dev set up on the thing let's quickly move to code so we said okay we want to while we move on we want to make sure that we want to reduce the violations in the system we want to reduce if else conditions in the stream how do we do that so we spin up quickly sonar integration we use the jaco co for integrating with sonar and then we at least started seeing the status as to how is how good bad or worse is our code I mean to answer your question the code coverage still is pretty poor but from zero percent to that percentage it's still not as bad as important point is having confidence right I've worked in code business where we had a very huge percent of coverage but still you know the confidence was very low so I think what's important is having confidence rather than the coverage numbers can also see now number of test cases are going up violations are coming down how did we achieve that so I'll come to that one so we'll move okay we said okay while we do that how about you know covering one more layer of one more layer of the pyramid so we can see that while the workflow test cases and the normal day to day process is fine or the application works fine let's see if we are we are but it's make sure that we don't break the UI part of it so we write but you know around eight the test cases your automation for around eight just to ensure that the from the user's perspective they're able to navigate through different things they're able to use it we don't want to put too much heavy emphasis on the UI test we didn't want to make that portion is covered as well so it's not integrated we are making sure that it is well within the limits just like one minute for screens to cover up so so far what did we achieve basically at this stage I think we had safety net built so people had confidence in being able to go in and modify the existing code and build on top of it rather than basically taking copies of it we were able to get fast feedback once people check in because of the CI and Jenkins integration we were able to cover four layers of the pyramid one step at a time three are integrated into the CI one still we are working on that but at least we have that feedback cycle put in and then we were able to standardize the development environment so everyone's working on the same development environment it's scalable someone else comes in it takes less than maybe a few hours for them to be up and running which used to be few weeks earlier for them to just set up everything on a legacy project so I think those were the four key things that we were able to achieve I think it's been end of December end of December to till now and the most important thing still keeping the business happy about it so I think we'll pause here this further steps and stuff like that but I do want to give people the opportunity to ask some more questions at this stage we have not had looked at performance test but at some point we do need to do that the nature of our application is basically it's a nightly batch job that runs so per se performance right now is not a bottleneck for us but as we start building and scaling more or more airports into this we will have to look at that element so right now we are not worrying about that most of our so your question is where was most of our business logic most of the business logic was distributed all over the place this is an analytics product which had a whole bunch of stuff happening essentially in the back end if you will right because it's data a whole bunch of data comes in overnight we take the data we crunch the data we generate a whole bunch of we run analytics statistics on top of it and then we generate some numbers shove it into another database someone else comes picks it up so a lot of logic was in the back end but we also had some other places where logic had like databases itself had a lot of logic in them standard development environment was to ensure that everyone's working on the versions of things they have things set up in the same way so that when someone comes in new it's kind of similar I can run things in a consistent manner everyone's using similar eclipsed versions with the right sort of plugins all of those things to make sure that the environment is consistent across people we he also talked about you know instead of each one having their own copies of the database we all work in the consistent copies of the database so there are scripted now with the moment you check out code you run the ant task and basically will bring your database version up to the latest and greatest version so things like that that's basically what we meant by standardizing it somebody was running jboss as a console application some other was running jboss as a service that's not going to help I mean the short term when we have small size that's okay but in the long run it's not going to help someone over there had a question the UI is the top layer is to focus on the navigation so a user could log in and go from all of these things they can navigate automation tool as in when you say all the automation tool but UI automation tool selenium is what we used for the UI and we wrote 6 tests just 6, 8, 8 tests in total that's 1% of the entire thing actually other products are already in Jenkins we have active support DevOps already aligned so it was a pretty simple choice for us to move it to Jenkins it doesn't matter what color pant you wear I mean when it comes to basically focusing on this thing I don't think Jenkins team city that would make any difference pretty much all of them provide the same functionality alright thank you very much we are going to let the next speaker come in thank you very much


Hello, when you open GeoGibber, you will get a screen like this. As I want to set up a GeoBoard, 9 pin GeoBoard, I need to set a few things right to start with. First of all, close the Algebra window because we just want the geometry. Next, look at options, labelling, and I want no new points, so none of my points will come with a label. Now I want to put on the grid so that I can set my GeoBoard up on a unit grid. At the moment I will leave the axes there so that I can see what I am doing. Now I am going to make a regular polygon and we can make it here like that. Four vertices and OK. That is not quite big enough for what we want, so we move it up a little bit there so that we can get that number of points. Now as you can see from what I have just done, I can move the blue points but I cannot move the black points, and that is a clue. Now I am going to set another regular polygon using the two black points which are not movable with four vertices and that will go there. Now what I want here is to be able to put in midpoints to get the points on my GeoBoard. Midpoint or center. The midpoint of that line, the midpoint of that line, the midpoint of that line, the midpoint of that line, and then we can do the last one between those two points. So I have now set up my GeoBoard. What I want at this stage is to be able to remove the construction lines, because as you can see if I move either of these blue points the whole thing is going to go wrong. So looking here at the last pull down menu, slow show height object. I can hide that object, I can hide that object, that object, that object. If we go back to the arrow, everything has gone except my nine pins. Now it's very useful to have your nine pins and these are at unit points around. They're not. They're not. I need to move it in. So let's go back to show height object, show height objects, and just unclick that one. And now I can move that one in, and there I have them at unit points. Go back to show height objects, click that one, and it's disappeared. It would be useful now to remove the, no, first of all, I would like really to have a square around those points. So enlarging up and moving the graphics window, it would be very nice to have the square around it, which is a regular polygon from there to there. And again four points. So there is that regular polygon. And if I go now for show height objects, I can remove that one and that one. Okay. And I now have my board. It would be useful now to remove the hexes. They're not there. That looks like the board I want, but maybe I don't want these spares on. Maybe I also don't want those top two points. Well, I can get rid of those, clicking on them there, and they have disappeared as well. Now, if I don't like the color of that square, I can double click on it. Object properties and the object property of the third polygon, which is there. The show object, if I unclick that, it disappears. So click it. But the color is the opacity is at the moment there. And I can make the surround if I wish black. And that looks better. So there is my geoboard. At this point, it would be very sensible to save the geoboard before doing any further work. And to do that, you go to file, save, and we might call this geoboard. We can save it in documents and it will dot ddb, saving it. Okay, having got that, it's now possible to use it to draw a polygon on it. For instance, I can draw this trapezium. If I don't like that trapezium, I can just remove it with the yellow arrow or replace it again with the green arrow. And this is now a working board to use on your white board.