And we'll have a problem session starting at 10.15 in the morning. Continue. And then we'll have the afterwards at 10.15. Right. So last time we were discussing, hold on one second. Right. So we were discussing some of the really foundational understanding of weight mechanics. How we think about the weight function. So fundamentally the main interpretation of the weight function of course is the weight function related to the ability of the weights and the square of the weight function. At a particular point telling us about the probability density to find the particle at a particular point. Space at a density obviously at some given time. And that probability density in a mechanical system will generally flow. And that flow equation, that kind of equivalent of fluid flow that we think about is described by the continuity equation. The continuity equation is familiar mostly to most of you I'm sure in the context of electricity. Magnetism where rho is the charge density and j is the current density of charge. But it's a general statement of flow of fluid, whatever that fluid might be. And the physical meaning of the continuity equation of course is conservation of whatever stuff is flowing. In this case it's thought about as a conservation of probability. Which really is to say that what we're saying in this situation is that in a system where we're described by a potential where the potential is a real function the particle is neither created nor destroyed it just moves. And that movement is described by the flow of the probability density. And that is described by the probability current which written in this form we see as whatever the local density is times a sort of effective velocity of flow and that effective velocity of flow is determined by the gradient of the local wave front to the system. So we think about the probability flowing along rays which are the normals of the wave fronts. So more over what we, of course one of the foundational ideas which made at the heart of the whole development of the quantum theory was the understanding of wave particle duality. I mean wave particle duality is where the whole idea of the probability amplitude arose and all the craziness that we've been talking about relative to quantum mechanics came from trying to understand the nature of the world and the foundations of physics Newton come from really two things mechanics and optics and trying to understand the nature of the motion of the heavenly bodies and the nature of light is really the foundation of physics. And there were sort of, of course, within that, particularly in optics there were the competing theories of optics, the particle theory, the corpuscular theory as Newton called it and the wave theory which was Huygens' idea of what the nature of light was. And so in the sort of particle picture we have the idea of a ray of light that moves along a particular trajectory. That was Newton thought as visible that light was made up of tiny little particles that were streaming at super high speeds and there were forces exerted upon them by material which caused them to refract and reflect. In modern theory we know that the ray theory of light is a limit of the wave theory of light in the short wavelength approximation and the description of rays is unified with the description of the motion of particles and the mechanics of Lagrange and Hamilton. So it's not a very nicely written chart I can try to write this out in my notes more clearly of the complete analogies between these things. So in the ray theory we have, we could leave the equation of motion of the rays follows from an action principle. That is stationary, the trajectories of the rays are the stationary functions, the solutions which make the action stationary under perturbations around those trajectories. And that's codified in Fermat's principle. Fermat said in the 17th century that we can understand the trajectory of a light ray in a medium in terms of minimizing the time it took for the light to get from one point to another. But in modern parlance what's that saying is that there's an optical pathway and we're minimizing the optical pathway. And the optical pathway is determined by the local index of refractions. And the solution to this is basically a Rayleigh-Lagrange equation that we know from this side where the motion of the particle in a potential is determined by the stationary action and the trajectories which minimize the action where the action is unchanged with small perturbations around those trajectories or the Lagrange equation, which is Newton's law, f equals ma. So that's the particle picture. Competing with that is the wave picture. In the wave picture, we have a wave equation. The equation of the wave, say for the electric field moving which has some frequency omega moving in this index of refractions is this. And the Huygens principle basically says that the rays are the normals to those wave fronts. And if we have the iconal approximation, which is to say when the wavelength is small compared to whatever the length scale for change of the same index, we have a solution which is the same as this. And the iconal approximation, under the iconal approximation, we have a wave, this is the wave solution, whose rays follow Fermat's principle. This is an approximation under that case. Now, on this side of the equation, there's kind of an interesting history. So this equation, which I have no room in my horrible plan, this is the Hamilton Jacobi equation. The Hamilton Jacobi equation is follows from classical mechanics. It's not a wave, it's a mechanical theorem. But what we have seen is that this equation follows as the geometrical optical approximation to the Schroder equation. In which case we understand that classical dynamics of a particle, the trajectory that a particle follows in the classical limit, is the limit where the wavelength of the brain wavelength of a particle is sufficiently small compared to the length scale where the forces change which would cause diffraction of those waves. And when we don't have such diffraction, then we have rays and those rays follow the classical. That also gives us a way of writing down a solution to the Schroder equation when we're in this approximation. And that is what is the WKP approximation where we basically use the Huygens wavefront associated with the surfaces such that the rays of those wave fronts are the classical togetheries. So when the wavelength, the de Broglie wavelength of a particle is sufficiently short compared to the length scales over which potential is changing, we can write down an approximate solution. In fact the amplitude here is related to one over. We wrote down that solution last time. So of course all these things are unified together. In some sense what we see is that these two equations are the same and the unification of them is wave part of the wavelength. So in wave part of duality, particles with certain energy have certain frequencies and particles with certain momenta have certain wave numbers for wave lengths. Obviously from rational physics. And what we see here is that the unification between the wave and the particle theory is to say that we can have our general action principle here which is again always minimizing this optical path length but these are in fact the same thing. That this action from the point of view of a Hamiltonian this is the same thing as the Le Broglie here inside here. This is the Le Broglie dt which is this. And for a constant energy this was p dx minus b times the time difference. And with this relationship here this is equal to k as a function of x the x that's a times h bar minus. So it's the same this action principle is the same as this action principle because what is k? k as a function of x is omega over c times n of x in optics or what we have over here it's the momentum as a function of x over h bar which is equal in mechanics to the square root of twice the total energy minus the potential energy. That's what's going in here. So we have exactly the same unified theory. There are waves, there are rays which are limits with short wavelengths and they undergo exactly the same action principle where the effective index of refraction in mechanics is given here. So notice that though that there is this kind of weird relationship a bigger potential here corresponds to a smaller index here. Notice in particular if I look at the phase velocity that's omega over k if I look at what that is locally at some position of space in this gray picture whereas if I write in the wave part of the duality this is this. Which is it a curious thing? What it's saying is that the velocity of these wave fronts that move in order to ensure that the normals of those wave fronts are the classical trajectories move inversely with the speed of the classical particle which is why Newton got it wrong. Newton said that inside a material light moves faster. The only way you could get refraction to work. Now no one could measure the speed of light at Newton's time. So maybe Newton was right. But Huygens' principle kind of took over and once they measured the speed of light and saw the speed of light move slower then that doomed the particle theory. The particle theory of light was thermodynamic. It was totally bogus theory. Well it's hard to measure between c and half c. We couldn't measure anything. So that's an interesting fact. However, it is quite curious that Hamilton's Jacobi equation is and Hamilton knew this that he could understand the trajectories of classical particles as the rays of a wave front. We didn't call it a wave front but these surfaces that were moving. But interestingly, there's no way that he could have guessed that in fact the classical mechanics was the ray optics limit of a more fundamental wave theory. But it is and it's all together. Now, so this unification is pretty clear. There's of course many subtleties to this. Should we think about the electric field as the wave function of the photon? Kind of. The subtlety, the problem is that the photon is a relativistic quantum. And relativistic quantum mechanics has some differences with respect to the non-relativistic mechanics. The notion of localizing particles of relative. You can't do that because particle number isn't considered. And what it means for it to measure the position of a particle relativistically is a much more subtle question. As I said, position is demoted. But nonetheless, these analogies should be kept. The final thing, of course, we talked about a little bit at the end of lecture last time, the idea of the path integral. And I would encourage you to read about that some of yourself. There's a nice beginning description of it in Saccharized Texts. And Saccharized Texts is quite good. I recommend trying to get a hold of it if you don't have it. But we can understand the quantum mechanics in saying that instead of having a single positive trajectory quantumly, in some sense, the system explores all possible trajectories. And they're weighted by a probability amplitude that's given by the local action of that trajectory. And that principle that connects classical dynamics and classical action of quantum dynamics is a foundation of quantum mechanics. And we use it all the time, particularly in quantum field theory and in statistical physics as well. So I would encourage you to take a peek at that. No key difference. All right, so now let's get into some nitty-gritty. So, given this, we're just going to go at light and speed today talking about something you've studied over and over and part of a box, all that stuff. I just want to get some of this, some of the foundations down. So we have some potential as a function of x. And say it looks like this. What we call the zero tetra-energy is irrelevant. So, classically, of course, we have different kinds of motion that can exist in such a potential. Remember, of course, we have a potential energy to conserve. So specifying the energy and the initial condition completely specifies the trajectory, classically. That's the standard trick to do. You want to throw up a ball how high it would go. You could just use conservation of energy to do it. So, for example, if a particle started at some position, if its energy was this and it started at some position, it will oscillate between these two points, their turning points. Because, of course, the total kinetic energy will always be bigger than or equal to the potential for all x. So, this is one kind of solution. If we started up here, then I'll have this one turning point. This is another possible trajectory. Come in here, bounce off, and come back. If I started over here at this energy, I'll hit this guy and bounce back. If I started over here at the same energy, then, of course, I'll hit this turning point and bounce back. This is classical. So, now it's, of course, talking about the quantum mechanics. So, classically, we have this supposed to be at the same energy. So, this, of course, in this case, this kind of solution, we call scattering. So, a particle will scatter off this potential. This is also scattering. This is bound motion. This is the bounce motion of the particle. Now, of course, you know, and it's even alluded to, if I look at this, so I look at my Schrodinger equation in 1B. This is the equation that we just, the time independent Schrodinger equation has this form, momentum over HR, which is 2. So, as we said here, classically, k squared can be negative. Classically, p is a real number, which means that it must always be the case that p squared is positive. So, with that, but of course, quantumly, k squared can be negative. There's nothing ever to be said, which means that k of x for when the, for p less than v of x, this is imaginary. No. So, that means the local solution, if I think wk be like, That'd be k squared if it looked like k, k was squared. So, if k squared is minus k, because k squared can be negative. So, the wkb solution, which gives us a hint of things, will be of the form, e to the minus kappa, at least kind of the exponential tails. Of course, what that means is that what was classically forbidden, this is this region, the particle, if it had this energy, it cannot be in this region to become classically forbidden. Now it's classically allowed. It means, of course, that we can tunnel it. And so, we have tunneling, unequally. Moreover, these two solutions now can, in some sense, become mixed. So, what that means is that when I have this kind of situation, when I can have a scattering resonance, as we will study next semester, if you come in with a certain energy, which is resonant with a wasi balance state, then there is a particular kind of scattering that occurs, usually the fact that the particle can tunnel in and rattle around at a resonant energy, and then tunnel back out. This is another kind of scattered interaction. Moreover, if I started the system here, classically whereas it would be bound, quantumly it has a finite lifetime, and it's only quasi-bound, and it can ultimately tunnel out. It means, in some sense, that the particle inside this potential has a finite lifetime. So, what can we say in general? So, firstly, if we look at this kind of potential, if it's non-singular, it doesn't blow up anywhere. At your first study in the public of your homework, if the delta function potential is quite high, if the potential is non-singular, and we say a few things, just from the solution to this kind of question. By the way, this kind of differential equation events under a certain, you know, 19th century study of ODEs. It's known as Stern-Liebel theory, and it's been well studied back then. Maybe I don't know if you guys talk about it in 466. I don't know. Probably not. Anyway, what can we say? The solution is derivative is everywhere, defined. Moreover, the solutions we seek in the solutions of those are the, that's our Hilbert space that we talked about, the square normalization of functions on the line. Now, what that means is that for bound states, because we have to satisfy the boundary conditions and because we don't want the solutions to blow up because we want to be able to look for normalizable solutions, then we have discrete possible unbound states are trickier. Generally, the unbound states, well, as we know, if we have a free particle, the energy eigenstates we can write down are plane waves. Plane waves are not normalizable. They are not in this set of square normalizable functions. Nonetheless, they form a basis of possible functions for this. And so we care about them for that reason because we can always write a wave packet or a superposition of the unbound states, which is a physical state. But that means because we don't have this kind of boundary conditions to worry about here, then the, what we, all we don't want is, so the unbound states is, they should be normalizable like a double function. In other words, they don't blow up more than a double function. The unbound states, though, don't have these boundary conditions, so we have a continuum of possible energy eigenstates. So what that means is that the solutions to the energy eigenstates, which is in the position representation, is this equation, written in the position representation, right, that the solutions to that form a basis, which means we can write a resolution of the identity in terms of generally the unbound states and then in addition the scatter of the states. So we have to integrate over all unbound energies. That's the resolution we're in. Note, when we talk about the scattering states, typically, because of the way we integrate over them, we typically give them units, right? The kets have to have the units of one over two over three. Just like when we had the kets in X, they have the units of one over the square root of length This is often forgotten that this has to be a resolution that it does. Now, it might be that the support of your wave function is dominated, has support on mostly on these vectors and not on the scatter of states, but if you really want to be formal and be careful, you have to think about both the bound and unbound contribution to your resolution of the identity. Now, one thing we can say about the solution. Another thing we can say about the solution is about the generous. Well, for the unbound states, the scattering states, we have uncountably infinite. We already saw that in the case of the free particle. The free particle, the energy is p squared over 2n but any plane wave moving with that momentum but in a different direction is also a unbound state. What about the bound states? Well, the answer to that is we will show in a moment that we probably have seen before. The bound states, there cannot be generous, no generous quantity. Of course, you know about higher dimensions of what we'll get to that in a little while. How do we see that? Get in here. You give me in the same way as classically, you give me energy and that determines the trajectory. In quantum mechanics, you give me the energy and that determines the wave function, the bound state wave function. That's not true in higher dimensions. If I tell you the energy of a planet moving around the sun, the energy alone is not enough to tell you the trajectory. We also need to know the momentum and the projection angle. If I have those three, then I can do the Kepler orbit and the same thing is true of quantum. Those are the three quantum numbers, the principal quantum number, the L quantum number, the M. All right, how do we prove this? We have to remember how to do it because it's not going to be here. So let's say, consider two solutions at the same energy. So I have two solutions, psi 1. So let's multiply the first equation by psi 2 star and this equation by psi 1 star. It's a trap. Actually, I don't think I want to multiply by the star. I just want to multiply by the star. So that means that d by dx of psi 2 d psi 1 dx minus psi 1 d psi 2 dx is equal to... which means that this, which is the Ronskian, is a constant. So what that means then is that the derivative of psi 1 dx over psi 1 is equal to d by... which means, if you just integrate that, that psi 1 of x is proportional to psi 2. So if you integrate that, you get the log is equal to the log and that means that 1 is just the constant of... and because you can always renormalize it, it means that's a different point because this doesn't follow. What is this constant? Because this says the constant is zero. S of this is equal to this. Otherwise, it comes here. For a balanced state, it must be the case that at infinity, so if the domain extends to... x goes to plus or minus infinity, the wave function has to go to zero for a balanced state. Right? Because otherwise it would be... even the plus x and it would blow up and that's not a allowed solution. So if that's the case, this goes to infinity, then the psi goes to zero which means the constant is zero. And then it follows. So that's why it's important to be talking about balanced states. Otherwise this just doesn't follow. So that means because a proportional normalization says that psi 1 must equal psi 2. So this is the same solution. So if we have the energy, there is a unique wave function for a balanced state corresponding to that. That's the same thing. That's true in the classical philosophy. If you give me the energy, if it's a balanced state, there's one trajectory. All right. What else can we say in general to things about this? So for balanced states, from experiment to experiment, first of all, you can prove the following thing. The lowest energy solution has no limits. Of course, what we call a balanced state. So over each subsequent higher energy state, does it kind of make sense physically that excited states and more and more excited states, states that have higher and higher energy have more and more limits. Why would that? Forgetting about Stern-Gildo theory, which is where this stuff follows, you can prove this mathematically. Why would we expect that we have anything here? That's not good. So let's have you know, would we expect this wave function to be a higher energy state than this wave? Well, I mean, what we know is something about the relationship between kinetic energy and the derivative of the wave function. So the kinetic energy, states which have bigger changes in their curvature have higher kinetic energy. So you kind of expect that. You're going to keep curving the wave function more and more, a wave function with lots of curvature has higher kinetic energy. So curvature. So what next? Well, there's one important class of problems that we often solve. And that is the reflection symmetric. That is to say, if a molecule has reflection symmetry, whatever that is, then there is important properties that follow to the solution to the Schrodinger equation. And that means the following. So the reflection symmetry is known as parity. Parity is a... And we've talked about briefly of continuous symmetries like space translations, rotations. Parity, which is reflection through the origin. So in 3B, that means x goes to minus x. So if I draw this, here's my position vector x, and I reflect it through the origin. In terms of minus x, minus x minus y, y minus y is even minus z. So that's reflection through the origin. In 1B, that's just along the x-axis going from x. So the parity operator is a unitary operator because we know that all symmetry operations are... What's the word I'm looking for in there? They can be performed by unitary transformations. So the parity operator, I'll call p, or pi, 3, does the following. It also turns a momentum operator to minus the momentum operator. And we see clearly from this that this is unitary because if I do it by, in the inverse of it, well, it's a unitary operator. We see here under this definition the parity operator is actually... its adjoint is actually equal to itself because the inverse operation is again the same operation. So this says that when you do it twice, you get the origin, identity. So what are the eigenvalues of this operation? Plus or minus 1. We know they have to be unit magnitude complex numbers. They're e to the i0 and e to the i pi. Because every unitary operator is eigenvalues or phases. All right. So, how does the parity operator act on eigenket? Well, it turns the eigenket to the position eigenket at minus x. So, if I look at the wave function, so I have a state psi and it's wave function where it's the position representation of the state. So what is the position representation of the parity operator acting on site? Well, if I look at the position representation of that vector, it's that. And this is the equivalent of the dagger of phi dagger acting on that. But this is equal to its own adjoint. So that is equal to minus x. So that's this. So the parity operator flips the state to what its value is on the minus x. All right. So, what can we say about this? Well, let's suppose we have a potential is reflection symmetric.  If the potential is reflection symmetric, what it says is that if I view the unitary transformation on this potential operator, that evaluates to this, right? And if this is reflection symmetric, this is this. The kinetic energy is reflection symmetric. Because p goes to minus p, but this is p squared. Which means that the Hamiltonian, if the potential is reflection symmetric, the kinetic energy is always reflection symmetric. Therefore, the Hamiltonian is invariant under that is to say if I do this transformation and what that means is that I'm multiplied by a pi on the left or equivalently h can use. Commutes. So this is an important result for reflection symmetric potentials the Hamiltonian commutes to the periodic operator. Now, if two operators commute, what can we say about their eigenvectors? That at least they can be the same. There exists common set of eigenvectors of both the Hamiltonian and the periodic operator. But to this, there exists common eigenstates. We can say more because the only way they can be different is if there's degeneracy. Right? Because when we can have degenerate the degeneracies of the eigenvalues then there can be different eigenfunctional positions of which might be eigenvectors of one operator but not the other. As we discussed with the block diagonal matrices and all that at the beginning of the semester. However, if we're talking about bound states that extend to infinity which means for these cases energy eigenstates are eigenstates of parity. So that means that if I have a solution that is the nth bound state that this solution is an eigenstate of parity which means that this has to be plus or minus that. Which means in weight function language if I multiply the cat here that u n of minus x that's x on that is plus or minus which means that the solutions the bound state solutions in one day are for as reflections metrics potential are either symmetric or anti-symmetric. Correct? Then so let's look at some simple solutions. Of course, the solution we all know off the top of our head is the particle in a box. Before I do that I guess we should say the problem thing of course. The solutions that are easy to write down are easy but quickly if you write down are solutions with piecewise constant. What I mean by that is that my potential a constant be 1, 2, 3, 4, etc. So we can write down those solutions instantly because in that case in any region of space where the potential is constant then my Schrodinger equation takes the form of effectively a simple harmonic oscillator where k0 is the square root of 2 and e minus v0 over h1. So we have two kinds of solutions and the classically allowed k0 is real. In the classically forbidden regions k0 is imaginary. In this region the solutions are of the form e to the plus or minus i k0 x or sine and cosine and in this region the solutions are either the plus or minus kappa x or the cosh and cinch. So depending upon the energy here in this region is classically forbidden here is classically allowed all these regions are classically forbidden this region is classically allowed this region is classically forbidden and so what you do and you've done this is you put these solutions in and you match them at the boundary conditions with the condition that the wave functions doesn't blow up so here the wave function has to grow like e to the plus kappa 1x and here it goes like e to the minus kappa of all this then inside here you have to match that the wave function is continuous and the wave function is derivative is continuous because let's move this even though the potential is not continuous the wave function is now if a couple v not goes to infinity then kappa goes to infinity which means the wave function does not into the city so if I have a potential that's a square well and this goes up to infinity then we know that the solutions can in fact we can sketch solutions they have to be eigenstates of parity so they're cosine sine cosine etc so we have cosine in this case we can write that solutions automatically because the solutions are eigenstates of parity the eigenstates of the Hamiltonian are also eigenstates of parity and because every wave function has one more node we go from an even to a not to an even to a not okay if this was a finite potential again the same thing would be true so if I had a potential where this is now v not to infinity well now I can penetrate in a little bit and I have solutions and there's a finite number of down states again we can alternate them from even parity odd parity even parity and know from the fact that they must go from even to odd to even how this guy must be either the plus or the minus half of x or even guy whereas on the other side over here we have the other kind of solution and this is minus because it has to be odd so you should use parity when you have it now I want to conclude with one last thing about this and again I'm not going to go through these details or in the notes before many times a part of my box is kind of what we do in mechanics we're not going to do it here you'll have some homework to review those things but I'm not going to go through that in detail but I do want to say one last thing in our laboratory suppose that I have a double well doesn't look so perfect but it's supposed to be reflection symmetric reflection symmetric of this guy so we know in this situation that the eigenstates are the eigenstates of parity and they alternate from even to odd to even to odd and the ground state has no notes so we can sketch that the ground state solution the part of the molecule tunnels in that's the ground state what's that? we're going to quit in two minutes but you can that's it the first excited state has one note and where is that note it has to be in the middle because it's anti-symmetric so the first excited state with some energy over here looks quite similar it looks like that the next excited state will get a much higher energy of course it's got to be an even parity solution and then the next one is not a parity solution which looks quite similar but has the opposite parity so these solutions come in pairs of symmetric and symmetric combinations of the particle localized in one or the other well what would happen if that barrier between this went up to infinity well they're not necessarily they're both even in odd solutions particle can tunnel into from one side but it can't it can tunnel into this but it can't get into that region this region is impenetrable it's a hard wall it's another word for infinite barrier it's a hard wall which means that in that case the particle really has those notes there's a little bit different we have those opinions so there is a solution that looks like this and it's a perfectly good solution it satisfies all the boundary conditions the wave function is just localized there another solution where the particle is localized here and then goes to zero and then it's never anywhere else those solutions are degenerate they don't violate this theorem that we proved because we said something about the particle being able to extend from plus and minus infinity when you have this case where you have an infinite barrier you can have degeneracies and this kind of solution a solution which doesn't respect the symmetry of the Hamiltonian does it say psi is not an eigenstate of a parity even though the Hamiltonian is an invariant it's known as a spontaneously symmetry broken state in terms of spontaneous development here I can just call this a symmetry broken state that's only allowed if I have degeneracies if I don't have degeneracies it's impossible because you have to have simultaneous eigenstates of the symmetry and the Hamiltonian but when you have degeneracies then I can take this symmetry respecting eigenstates well they're symmetric an anisometric combination so there is another solution which is perfectly degenerate which is this one this solution is even it's a linear combination of the two of you there's another solution that guy is the degenerate the degenerate solution this is the anisometric combination so as we said when two operatives commute there always exists commonizing space but if there's degeneracy I can add these two they all have the same energy and they would be localized on this side or I could subtract these two and it would be localized on that side so final comment given this and given this degeneracy what can you tell me about this energy splitting between the symmetric and anisometric states for a finite barrier well they have something to do with how much the particle can penetrate into the barrier because as I raise this barrier these these doublets come degenerate so there's something about the mixing of these two states that breaks the degeneracy and that's an important problem I will stress in more detail degenerate perturbation


A secret the Narcissus doesn't want you to know. There is a piece of information that is not generally known about the Narcissus. It may be known by the people who watch my videos but many of the Narcissus sources of supply, enablers and flying monkeys may not be aware of this and the reality is that everything the Narcissus does and everything you see from them is fake. It's an imitation. It's done in order to deceive.  That is fake too. That's not really them because they have a void within them. There's actually nothing there. It's an illusion and the illusion is powered by your belief or someone else's belief but whoever it may be. The Narcissus cannot generate their own power or energy from within which is why they're always seeking new sources of supply. It's why they're often surrounded by the enablers and flying monkeys and even when it seems like they're alone they're always on their phone, they're on dating apps or social media. They're constantly engaged in something with other people because they can't be alone. It would be like death to a Narcissist because there's nothing inside of them and if they were ever left alone even for a short period of time they would lose their minds. They would go insane. It would cause a Narcissist injury and they would probably lash out at you because they are their own injury. By this point you may think that you don't want to be around them but the reality is that they don't even want to be around themselves which is why they hate alone time. The last thing they want is to be left on their own because there's just nothing there, there's no human inside of them, it's just an empty shell and any type of introspection destroys them. It drives them insane because deep down they know that something is seriously wrong with them after everything they did to you and all of the lives that they destroyed. They know that they're messed up but they don't want to accept it so they try to escape and distract themselves with all of these mind-numbing addictions. Whether it's the addiction to people, alcohol, drugs, shopping or gambling it's all just to take the heat off of themselves so that they can feel normal and sane as though they're doing nothing wrong but this illusion is not self-sustaining because it isn't even real.  Without that the entire thing falls apart because they have no power of their own to create or sustain anything, it's like the lights are on but no one is home. There is no real human inside of them, there's nothing there which is how they can be whatever they think you want them to be or whatever they think will give them recognition or make them feel powerful which means that even when they're devaluing or discarding you or triangulating you with someone else that character is fake too, there is nothing inside of them which is why they're so outwardly focused, they constantly react to the things outside of them, they're hypersensitive and hypervigilant and if you're around them long enough you will begin to take on some of those traits, they will pull you outside of yourself and into the world of magic and make-believe because your identity and sense of self is a serious threat to the illusion, it reminds them that they have nothing of their own, it makes them hate and despise you because they're fake, they're not real people, if the right situation or opportunity presents itself to them they will give up on all of their acclaimed or proposed values and beliefs because they have no inner sense of value, it's just a void that they're trying to fill because they can't generate anything from within which is why they will quickly give up on everything that they're meant to be representing if the right situation becomes available to them but they can manipulate you and give you the illusion and at times it may seem like they have changed as though there might be something there but then they will quickly revert back to their old ways because the truth is that they can never change or grow, they are the same dysfunctional shell of a person until the day they die, it's just an artificial intelligence, it's a machine, it's just things that they've learned from other people, they can't expand on anything, they can't express that length or in greater detail because they have very low energy reserves and their energy is negative, it exists only to suck the points of energy out of other people in order to sustain them which is why they're always so pessimistic and defeated, it's why they like discipline and self-control because there's nothing holding them together from within, it's either you or it's someone else, someone who is keeping them together, someone who is making them feel comfortable and sane by feeding their ego and validating the illusion but if you take all of that away you would see an emotional wreck, a bitter resentful person who is very sad confused and desperate someone who doesn't even know who they are or what they stand for that are the women of their surroundings, whatever is presented to them rather than what they actually value or believe from within which is why they will often seem to wish desire or decide things in a certain way because it's just whatever gives them life, whatever makes them feel like their false character exists because without anyone to validate the illusion they wouldn't know where to start, they would have to find a way to indoctrinate everyone to damage them or to keep their vibration down so that they don't realize the truth because the truth is that everyone around them is being brainwashed, they're being pressured into adopting radically different beliefs but themselves are the people in the world around them and these people eventually become heavily dependent on the illusion as well because it provides them with a sense of value belonging and well-being, they lack the power to stand on their own, to be independent of other people and anyone who is independent reminds them of that truth which is why they don't want you to go off the beaten path, they want you to be enmeshed with everyone else, they want to control you because they feel like you're taking something away from them but you're actually just reminding them that they're not who they say they are because you're real you've done the work, you've spent a lot of time alone to yourself which means that you've established your own values and identity while they were just at the whim of everyone else, they were just being what everyone else wanted them to be, whatever they thought would help them to fit in, to be socially compatible with other members of their group to where they develop this high-mind or group-think mentality because they don't promote individuality, they don't encourage people to think for themselves or to make their own choices and decisions so in order for them to be compatible they have to abandon their own identity, it's like an unspoken rule and this is why they appear to lack discipline and self-control, it's why they have so many coping mechanisms and addictions because there's actually nothing inside of them, they're just whoever they need to be to maintain their power and control over you and when a person persistently seeks power and control they end up abandoning themselves in the process, they lose touch with who they are as they develop an inability to generate their own power and energy from within because now they're seeking it externally and that is why they're always so miserable, it's why they're so envious and hateful because you kept it real, you remain true to yourself and they didn't, they had to abandon themselves to gain power and deep down they know that they made the wrong decision because now they can never experience true love or happiness, they have to settle for less so what they tend to do in these situations when it's all said and done is they try to live vicariously through other people, through their pain and suffering especially if they were the cause of it so that they can feel better about themselves so that they can feel as though this situation isn't that bad or they try to triangulate you with other people, they try to manage and control your perception, they do all of these things but in the process they're just digging themselves into an even deeper hole that they're never going to be able to pull themselves out of because by that point it's like pull themselves out of what this is who they've become and they're so resistant to change because they wouldn't know where to start and they know there's no way that they will be able to compensate for all of your years of loyalty and dedication and everything that you provided to them during that time so it's almost like they have no other choice they're predestined they have to continue on that path because they already burned the bridge them having any real sense of moral character or authenticity which is why by the end of it they try to control you for their flying monkeys or smear campaigns it's characterized by their absence rather than their presence they stay distant because they already know that they're not going to be able to uphold anything they said they were initially about and by that point they've realized who you are and that anything they present to you is going to be no match to the person that you've established yourself to be so they have to stay out of sight unless they can still find a way to manipulate or gas like you because you become like kryptonite to the narcissist it's like sunlight to a vampire going like blinds them and intimidation overwhelms them because they couldn't do that they gave up on themselves a long time ago they had to resort to deceptive means and it may look like they just became that way when they targeted you but people don't change overnight that's just the facade they were already that way long before you met them which is why they hold on to the illusion so strongly because they're actually very insecure they already know that there's no real authentic part of them which is why that moment when they're granted yours is actually when they are most vulnerable it's when they can be most reactive to your criticism or rejection because they already know that what they're presenting to you isn't even real they know that they're just reflecting back your own virtues and ideals to you which is just something they made up in their minds it's not something where they actually spent years in isolation to become that they're just an imitation they're not the real thing and you will see it in their eyes if you ever confront them or threaten to expose them the eyes will light up do what become visibly alert like they're in a heightened state of awareness because in that moment they know the jig is up they know you're on to them and then it's all about getting you before you get them or they will just run and hide because deep down they already know that they're not enough they've never done the work so they're not who they acclaim themselves to be which is something that you may have witnessed already if you've ever gone along with their proposals or ideas you will have seen that it always results and I'm not even knowing what to do with you because it's just something that they saw in you and then they reflected it back to you oh it's just something that they're made up inside their heads and if you allowed yourself to be meditated by them it became a shed fantasy to where you felt trapped and powerless because that's all that it is it's just a means to strip you of your power by playing on your wishes fears or fantasies it's not something that has any basis of reality because they're not real and you will know that they're not real if you pay attention to your intuition when you're around them because all it does is drain you and leave you confused the illusion is all that they have and as I've said before there is nothing outside of the illusion because they don't have the mental and emotional capacity to even be a complete human they like the qualities and skills that even make it a reality they like empathy so they just stay dreaming and they're hoping that you will go along with it because you do have the tools of the inner resources to make it feel real for them but if you could ever confront them on it or hold them up to what they're suggesting or directing you towards you will see them crumble right in front of your eyes because they don't even have the means to make it a reality they just wouldn't know where to start and even the times where you feel like you've seen the narcissists let their guard down and you've seen them be vulnerable even then it's just not a pretty sight there's nothing attractive about it because it's just all about themselves and their emotions it's never about you unless they're displaying the illusion but even then their display of vulnerability is just another illusion because it's just used as a means to gain your sympathy and compassion without any intention of them changing or being better because they're quite comfortable with their disorder it allows them to hold up this wall to protect themselves because they already know that there's nothing lovable or attractive about them and that it's just something that they will use to play the victim and gain sympathy because that's all that they can do once you figure them out they have an inability to connect they lack empathy so they already know that the moment you figure them out it's when you're ready to get out of dodge because by that point you realize that they're all about themselves it's always this woe is me damsel in distress mentality it's never about you or how you feel they see you as an extension of them so they assume that you share their feelings and needs there's never any compassionate understanding with a narcissist and yet they wonder why we end up trying to avoid them and then they come back trying to seduce you with money or sexual favors because they're assuming that's what you want but that's likely what they've been used for in the past so at times it just doesn't make any sense to them because in their minds that's all that there is they assume that you're just being stubborn and naive because they're very superficial everything is outwardly focused and there's always this sense of urgency to whether only focused on the destination because the journey and the moment actually does nothing for them they're like dopamine junkies it's what drives their motivation and addiction so they only see what exists on the surface they don't see the real human part of you because they lack effective empathy so there's no real human side to them because they're missing those key components which is what enables their disorder to function because if they could ever experience those things they wouldn't be able to be narcissists stop them in their tracks but this is also why they're so miserable and it's why the only thing you can do is part ways because you're never going to be able to reach them which in the end will leave you feeling unheard and unseen because again that's the only way that their disorder can function it won't work if they have to accept that they're dealing with a real separate person so they have to see people as extensions of themselves but that is not true connection it's actually disconnection because they're disconnected not only from other people but also from themselves because there is no self there's nothing inside of them which is why it's so validating and empowering when you find videos such as this because it reminds you that you are not alone but you do have a self and that you can be so much more than what they led you to believe thank you for watching if you found this video helpful please give it a thumbs up share your thoughts in the comment section hit the subscribe button to receive the notifications if you would like to support the channel you can donate at payable.me slash Narc survivor you can book a one-on-one with me on my website it's Narc survivor the Narc at UK thank you for watching and I'll talk to you soon


Welcome to the session one end-to-end test code as first class citizen by Abhijeet Biker. We're glad you could join us today. Also, we would like to thank Apple Tools for sponsoring this session. And without any further delays, Abhijeet, the stage is all yours. Thank you. Thank you Lavanya. Let me share my screen. Hello everyone. I hope all of you are doing well in the current pandemic situation. It sure has been a tough time for all of us everywhere, but I believe we'll soon come out of it and get back to a normal routine. Hey, did you all enjoy yesterday's Selenium Conf talks? I sure did. What a fantastic day it was. I'm sure today's set of talks are going to be brilliant as well. So today I'm going to talk to you about treating your end-to-end tests as first class citizens. Thank you all for joining the session and I hope you find it useful. A little introduction about myself. I am Abhijeet Biker. I'm originally from the city of Pune, state of Maharashtra in India. I've been testing software and writing test code since eight years now. Selenium and APM have been my friends all this time and I can't thank the projects enough for being an important part of my career. I currently work with Carousel as a software, senior software engineer in test in Singapore. I'm also a co-organiser of a testing community called Takila. It's a thriving and active community for all testers in Singapore. Recently, I also started working on a small project called How They Test. The project aims to curate and collect public resources by different tech companies on their testing practices and quality culture. The project is available on GitHub. Do check it out and feel free to contribute to it. It's time for a quick poll. I want to know if you are currently involved with active development, maintenance and enhancement of an in-house Selenium or APM-based end-to-end test framework and are also involved with automating tests. 81% of all the participants are saying that yes, they are involved with developing, maintaining and enhancing an in-house Selenium or APM-based test framework. Since majority of us are building or using frameworks and automating end-to-end tests, let's try to understand what value we want to derive out of our end-to-end tests. What do we want to achieve by automating our end-to-end tests? Some of the main goals or values we want to derive out of our functional automated tests are, we want our tests to detect regressions. We want quick feedback on the state of our products by running these tests frequently. And with this frequent feedback, automated tests help us achieve faster delivery cycles too, as the feedback loop with automated tests is much shorter than a human conducting those tests. Automated tests also give us the flexibility we want to perform checks at any time of the day from anywhere and any number of times. We also achieve reduction of costs in terms of the time it takes to test an entire regression suite with human intervention or the time it takes to fix a bug that was missed because of human error. Also, with automated tests, we are able to perform reliable testing. So imagine a test engineering team that is working on an in-house test automation framework and also contributing to end-to-end automated tests. At some point of time in the journey, the team starts having conversations like this. Today's regression run for Android didn't execute at all. Oh, God. Tests are failing locally. Did we change something in the framework? My tests were working until yesterday. Today they are not. Slack notifications are not being sent for test transfer. What happened? Someone accidentally checked in sensitive values in test code. Why? The branch name in the regression Jenkins job has been changed. Who did that? Signup tests are failing due to null pointer exception. What does this new method in the framework do? With such issues, test engineers are spending more time fixing issues in automated tests that could have been avoided in the first place. Does this feel familiar to you? Have you experienced such situations too? Aren't these problems coming in the way of achieving value out of our end-to-end tests? So how do we come out of this situation? We do so by ensuring quality of the test framework as well as the test code. But what makes a test framework a global quality framework? How do we define quality in this context? We can define quality here in terms of stability. So stability is in terms of stability of your tests. For example, a test is unstable if you use a poor locator strategy or a test is unstable if the feature behavior is indeterministic. Reliability. No matter how many tests are run at a given time, how many times the tests are run and how long the tests are run, the test execution should behave the way we wanted to when the test run is triggered. And lastly, ease of use. So a good quality test framework and a test code is easy to read, maintain, and extend as well. This diagram implies the effort or cost involved to fix issues found in your test framework or test code when it is found in the latest stage of framework test development. So an issue found while you are designing your test framework or test code is less costly to fix as compared to finding it when your tests are actually run for larger group of stakeholders. So when they are found in the latest stages, it can lead to a lack of trust in the automated tests by stakeholders. If you notice the impact is similar to the cost of bugs that are found in your production code, that is the product that you're testing. What does this mean? This means that in order to test, in order to ensure quality of your framework and test code, you should treat your test code as fair and as equal as you treat your production code. Before I share more about the journey of treating test code as production code at Carousel, I would like to give an overview of the end-to-end test automation practice at Carousel for better context of the practices I'll share. So for end-to-end test automation at Carousel, the development environment that we use is Eclipse and IntelliJ and the programming language that we use for writing automated tests is Java. We use GitHub for version control of our test framework and test code. We use Jenkins for continuous integration. We use Maven for dependency management and our automation libraries are Selenium and APM. We also use a test case management system called as TM4J. So TM4J is also used for maintaining the test suite of all the regression cases as well as when our automation test cases are run, the test cycles are created automatically from our daily regression and they are updated with the status of the test cases. As far as devices are concerned, we use devices from BrowserStack and we also have an in-house device lab called as CaroFarm. Our execution environment uses Docker for running the tests and we also make use of Slack for pushing notifications of the test runs and test results so that whenever any team wants to get results of the test runs, they can get it on Slack. We also use some form of storage, database as well as file storage for application builds, for logs, for videos and test accounts as well. What kind of tests do we run in end-to-end? So there are three different types of tests that we run. Fast feedback tests, these are the tests that we run for every pull request created by the Android and iOS engineers. These are like the most critical scenarios that need to be tested whenever any changes are made in the UI code. Daily regression runs are the regression test cases which run nightly for the nightly builds that are produced from the iOS and Android apps. And sanity runs are the subset of the regression cases which are usually run on the day of the release. So let us now look at some principles and practices we have been working on in our journey of end-to-end test automation. They are applied at the code level as well as at the process and people level. So first and foremost, all changes for test code and framework code go on the dedicated branch. We do not push any of the test code or framework code directly to master branch. Now this might be an obvious principle to a lot of us, especially for test engineers coming from a development background. But I have often seen this being ignored by many teams just because it's test code. But this should not be the case because test code is also important as production code. Now the next principle that we adopt is automated checks on pull request. So whenever a test engineer contributes to automated tests or framework code, we enable them to run some checks on their pull request. So any change that goes into the test code or framework code goes into the form of pull request on their dedicated branches as you saw in the previous slide. So in this pull request, the kind of checks that we perform are we check whether the code is formatted, we check whether the code compiles do unit or integration tests pass, does code pass SonacloudPoliticate and have the reviewers approve your PR. So if all of these checks are good to go, then the test engineer is basically allowed to merge the changes into the master branch. If any of these checks fail, then the pull request is blocked until it's fixed by the test engineer. Now we look at all these various checks one by one. First one is code formatting. So for code formatting, we follow a particular code style which is basically the Google Java style guide. Google Java style guide comes along with a Mavin plugin which we have integrated with as part of our build pipeline. So whenever a pull request is created, a build starts executing and as part of that build, the FMT Mavin plugin is also executed. So what this plugin does is that it will check and check through your entire set of changes in the code and it will verify it against the Google Java style guide. If any of the code does not comply with the code style, then it will highlight what files are not complying and you can fix them with a simple command like Mavin FMT colon format. So this is added as part of our pull request checks. The next check is static code analysis. So we are using Sonacloud as the platform for static code analysis. So with the help of static code analysis, Sonacloud, we are able to perform analysis on our test code as well as framework code and within the pull request itself, Sonacloud will highlight to you what all issues have been found in your code. So as you see in the image below, there is one bug, there are eight codes merits and there is 1.2% of duplication. So this is a kind of an automated check that gets performed for every change that happens on the test code and framework. Now we'll take a look, a detailed look into the Sonacloud checks. So this is a snapshot of Sonacloud platform for a particular test code repository. So one of the two of the most important points that we look into as far as the static code analysis is concerned is reliability and maintainability. So reliability is a criteria in Sonacloud which is checked against the possibility of code behaving differently than it was intended to. For example, a possibility of some code returning null pointer exception if not handled properly. Using two string method on an array instance instead of using arrays.toString. For maintainability, it gives us the amount of code smell that is there in your test code. Example of maintainability issues are using deprecated classes, defining and throwing a dedicated exception instead of generic one, avoiding catching of null pointer exception and then refactoring code to not include more than like three ifs or four or while switch try statements. You also track coverage. So coverage is basically the code coverage of framework code based on the unit tests and integration tests we write in it. Last year, Marit who is a well-known expert in the testing community and who also constantly shares great thoughts on testing and test automation tweeted, why isn't anyone in conferences talking about unit tests in your test automation to test some of the essential assumptions that must be true for your automation to still work alerting you on them breaking. That is one of the talks that I want to hear. So as I mentioned about code coverage in the previous slide, right? So that code coverage is basically for the unit or integration tests in our test automation framework. But what do we mean by unit and integration tests in test automation framework? Like what Marit said, in order to make sure that the basic assumptions of your functioning, proper functioning of the test automation framework is true, we can write unit or integration tests for certain components of your test code or test framework. What kind of components they can be? They can be code related to your driver management related to your test data handlers, configuration handlers, cloud service handlers, test case management system handlers, reporting handlers and all other classes that support correct functioning of the test framework. So over here, we need to be careful regarding what components we are writing the unit or integration tests for. Like if you have page objects and test classes, feature files and test specs in your test code, you really do not need to write unit or integration tests for them. You will write for the other core components of your framework. Now this is an example of what kind of unit tests you can write. So consider that there is there is a test suite core module of your framework which has certain services like login service, registration service and user service. So you will write unit or integration tests for these services. These services are this these classes are critical to the correct functioning of your test automation framework. So you'll write unit or integration tests here. Now going into more detail, let us look at what a unit test looks like for our test automation frameworks component. So I have written a test for login service. So what the login service will do is that it will make an API call to the login login API of your product. It will fetch the token and it will store the token in the hash map so that whenever you make an API call again you do not need to look you do not need to fetch a new token. It will simply fetch the token from the hash map itself. So this is the core logic of the login service. So I will write a unit test to ensure that this core logic in the login service is working fine. Similarly, there is a test for TM4j. So TM4j as I mentioned before is the test case management platform that we adopted. So whenever we want to push the results of test cases to the test case management platform we have written a utility in our test framework to do that. Now to ensure that the logic of this utility is working fine, we have written test cases. By the way, do you know that the selenium project has unit tests and integration tests too? So if you go on Github and check out the selenium project and go to the Java client, I mean this Java is just the example that I'm giving. I'm sure there must be unit and integration tests for other language bindings as well. But what I want to say over here is that your test framework or your test utility or your test tool is also another product that someone is going to use. So that means it's a good practice to add unit or integration tests for your test framework as well. Now coming to code reviews. So how many of us over here perform code reviews on your test automation code? Sam Connelly on Twitter tweeted once last year do you do code reviews on your test automation code and a lot of us responded that yes we perform code reviews. One of the practices that we have embedded in our test automation development is that for both the framework and the test suite repositories that we have, we have mandated two reviewers for all the pull requests. That means that even if like let's say I have created a pull request for my code changes in the test framework I will require two reviewers to review my code. Now both the reviewers need to approve my code only then I'll be able to go ahead with encouraging it. Code reviews are also quite important in terms of getting feedback from other team members in your test engineering team and this is also one of the practices that we adopted. Now another tiny detail which probably might not be of great significance but also it is quite important is pull request checklist. So what we do is that we have created a pull request template so whenever any test engineer creates a pull request they automatically get a template displayed in front of them on github which shows the checklist in terms of what all things need to be taken care of when you are creating your pull request. So things like understanding what kind of change this is whether this is a refactoring or whether this is a new test or whether this is a fixed on an existing test or if it's a documentation update. Also as I mentioned the due diligence part so we have a checklist below where we kind of it's basically kind of a checklist for ourselves where we'll tick mark those points to ensure that the due diligence has been done. So for example past locally android, past locally iOS, past locally web. Now another change that we have done is earlier we had the test framework and test code all of it into a single repository. At some point of time in our journey of into a test automation we realized that it would be a better thing to do if we split the test framework and test code into two different projects. So this was one of the things that we did the benefit that we gained out of this practice was that we were able to always refer to a stable version of test framework while anyone made any unstable changes to the test framework. So if you see over here the test framework we created the test framework in such a way that it can be included as a dependency into the test code. So whenever you want to run the tests the test will use the most stable version of the framework so any changes which are made into the test framework by anyone in the test engineering team the changes will not be included in the stable release unless and until it has gone through certain checks. The next practice that we adopted is moving from freestyle projects on Jenkins continuous integration to pipeline code. So pipeline as a code basically allows you to create your continuous integration scripts or continuous integration job in the form of Jenkins file or scripts. So it's basically nothing but code and code can be version controlled. So what we have done is that for all the continuous integration jobs that we have created on Jenkins all of them are version controlled in the form of Jenkins file. So whenever any changes are made to the CI jobs these changes go through the version control so that we come to know what changes are being made and these changes also go through review. Another aspect of quality over here is test environment for test runs. Now what does it mean? It means what we try to do was we isolated the real test runs from debug test runs. That means we had separate CI jobs for testing our changes to framework or test suite code. We also had separate TM4J test cycle for testing the integration of our framework with TM4J. So the actual TM4J test cycles do not get impacted. We also had a separate DB instance to test database integrations with our framework. So the whole intent of this effort was to not disturb the production tests no matter what. Now coming to the faster analysis of issues when things break. So in order to understand what went wrong whenever test runs fail we have made use of notifications in the form of Slack notifications so whenever tests are run on continuous integration after the tests are finished we push the results onto Slack channels. So as I mentioned before in the overview we use Slack as a communication platform so most of our teams communicate over there and it made good sense for us to actually push the test results directly to Slack. Now this is a snapshot of what you see is basically TM4J. So TM4J is a test case management platform and what we do is that whenever we execute tests from continuous integration we also upload the Java logs from the test execution and also the video records of the devices. Now coming to code coding principles apart from all the changes that we did in the code we also follow certain coding principles. Now this slide is a deja vu slide if you attended Gaurav stock yesterday on principles and patterns for test automation framework. Gaurav did a fantastic job on explaining these principles and patterns so I won't be going into a lot of details over here so we quickly go through them. So one of the things that we need to do is we need to keep the test short and atomic. Also need to take care of separation of concerns or responsibilities so since we make use of a cucumber JBM for defining our test specs we split the test automation code into feature files step classes, step classes call page objects and set classes are responsible for performing assertions and page objects are the layer which interact with the UI. Also we avoid repetition of code using dry principles and abstraction wherever necessary. Java docs is also quite important for public methods in framework code. So this is quite important from framework point of view as well where in anyone who is referring to the code in your framework the public methods in your code should also have Java docs. Efficient locators I mean we all talk about locators quite frequently and the practice is quite well known across the industry but let's say for example if there is a need for adopting XPath for any of the use cases of finding elements and that XPath could be replaced by a better alternative later as well then what we do is that we create a backlog ticket for the Android RIS engineers so that this is basically considered as a tech debt in your code and once the once the ticket has been created in the backlog for the engineers the engineers will be responsible for fixing the UI so that we have better selectors and locators also avoiding shared state between tests including use of static methods so in our case what we did was we tried as much as possible to eliminate the use of static in our code we also employed the use of spring dependency injection framework in our test automation code that helped us manage the instances of various classes using a dependency injection container another aspect of book coding principles also is to knowing when to catch exceptions and when to let them fail tests also being smart about the waiting mechanisms using a logging framework instead of system.org. so it's not really a good choice to actually try logging certain statements in your test code using system.org or printer and instead of that what you could do is you can use a logging framework for example in our framework we use log4j and SL4j not checking in sensitive data in the code repository so one of the discussions that I mentioned before happening in the test engineering team was like accidentally checking in certain sensitive data or sensitive tokens inside your test code which can cause security issues so you can use you can make use of some repository or a tool called as get secrets it helps you to avoid checking in certain sensitive data into your test code even before you post your commit to the repository also removing that code is a good practice to maintain lastly using voice code rule so what voice code rule means is that you should never leave like if you are working on something and you find an opportunity to fix it immediately then then go and fix it so leave your code better than you found it apart from the code changes and the design coding and design patterns and principles team collaboration communication and planning is also very important so the things that we do in order to ensure this is that we plan strategic changes to framework well rfcs are basically request for comments request for comments or documents which ensure that whatever important changes that you are going to make as part of your test automation strategy they are well planned they are well documented and many people or stakeholders have taken a look at it the questions have been addressed by the stakeholders and all possible conditions have been thought of before actually implementing the solution thinking about possible failures when designing solutions for test framework and integration prioritizing high impact tests for end to end UI coverage conducting sprint review sessions where any significant work done is demonstrated and made open to questions and discussions so we also perform sprint review sessions where any changes that have been done like for example framework level changes or any of the important tooling for test automation we demonstrate as part of the sprint review sessions and also encourage asking questions and discussions pair programming and pair installing sessions are also important for us where in let's say I want to implement certain complex complex solution as part of the test automation framework I will pair program along with another test engineer in my team also encouraging an open mindset is important when it comes to asking questions and giving feedback on code so this is important because whenever you are thinking of implementing something as part of your framework strategy or test code it's important to have everyone in your team on the same page in terms of the reason behind it so it's important to also encourage an open mindset where you allow your team members to also ask all the possible questions like why are we doing this what is the benefit of adopting the solution can there be a better or a simpler solution to this problem rather than what we are proposing last one is creating zero tickets at any time across tech debt so as I mentioned before tech debt is something which is at some point of time it's always going to be there but addressing that tech debt is also important instead of ignoring it when there are situations where you have to implement certain solution such as automation framework or test code and you want to implement it in a particular logic which is not the most efficient way of doing it then we ensure that this is tracked as a future improvement or enhancement in the form of backlog tickets so the key takeaways and learnings from this is that right unit or integration tests for core components and integrations that make and break your framework and test code create build pipeline for your test framework and test code using CI automate checks at PR level to avoid issues creeping into your daily test runs that matter conduct code reviews religiously adopt good coding principles and design patterns to ensure making changes in code is easy and lastly establish a practice of open and frequent communication in the team driven by retrospection and continuous improvement so that brings to the end of my topic and I hope this was a good learning for all of you and I would like to thank Selenium Conf for giving me this opportunity to talk about this topic and sharing the experience that we gained out of implementing this implementing various solutions and principles in our end to end strategy. Thank you this was a great session there are quite a few questions and we do have time to take a couple of them so maybe I could start one question is about can you speak about how automation is conducted in project delivery model is it in sprint automation and do you tackle B0 or B1 cases first and the remaining is like a constantly running stream so currently the way we tackle it is that we basically have some backlog of tests that we currently have a backlog of tests that we want to automate so these are as the question is mentioned these are the B0 and B1 tests that we are also in a journey to automate apart from that the question about in sprint so we are not currently implementing the practice of automating the features in sprint what we do is that we work along with the delivery teams and understand what features need to be automated in terms of the test cases and create a backlog out of those items and accordingly plan to automate them great one more question about framework code and test code so is there any way to verify that the framework changes actually break tests which depend on it what does the process really look like did you hear me worry yeah I am just trying to understand the question again can you repeat once again yeah splitting framework and test code in separate repository is great but how do you verify that any changes in the framework does not break tests which depend on it like what does the process overall look like okay so basically whenever any changes are whenever any changes are made into the framework code we also have a continuous integration for the framework code as well so as I mentioned before after we split the framework code and the test code into two separate projects we had certain checks and unit tests for we had certain checks and unit tests for the framework repository also changes that were made into the framework the continuous integration or the pull request build pipeline will also ensure that the functionality of the components or the core features of the test framework do not break yeah I think that answers the question thank you there's one more very highly voted question about duplications so Amritraj here says that test code is expected to have some duplications but how do you manage that and does sonar keep sonar cloud help in in this case yeah so as I mentioned right one of the one of the two of the main components or criteria that we use sonar cloud or we focus our efforts on when it comes to static analysis using sonar cloud is maintainability and the other one is reliability so as the question mentioned right it's correct that test code at some point of time can have duplications which is why that is a criteria which we do not strictly enforce but still we try to strive for avoiding duplications wherever necessary yeah that's nice also any tips on getting developers to contribute to writing functional tests okay so this is a good question we have been working with our client engineers basically the android and ios engineers to try to establish a practice where functional tests can also be contributed to by the devs themselves right now we are in a phase of transition where we are getting the developers to be acquainted with what automated testing and functional testing is in the first place because what we have seen is that often they do not have a significant experience and knowledge of tools like selenium or apm so the first tip that we are actually trying to achieve is that we are trying to train them on functional test automation using apm and selenium and after that we will try to engage them and get their involvement in writing functional tests okay great is any part of your framework code open source no okay i think it's not open source right now but i mean we might consider late at some point of time okay this one more very highly rated question about how many mobile builds are integrated with your test framework i believe it's more to do with how many times they run mobile builds in the sense the application builds yes i think so i would believe that it is more to do with how many times these tests are run so as i mentioned in the slides before in the carousel overview there are three different types of tests that run one is frequent fast feedback tests the other one is regression and the third one is sanity so for fast feedback tests these tests are run as many times as the pool requests are created by the ios and android engineers so whenever an android engineer let's say for example is has created a pool request for a new feature change in the android code we create a build out of that feature runs in android code we create the apk file and then we run certain smoke tests against the apk file using apm same applies for ios as well so this happens as frequently as the number of pool requests that have been created by the client engineers now for the regression tests they happen nightly that means that every night a build is created from the master branch of the ios and android code and against this build we run the set of regression tests I hope that answers your question I think most of the questions are covered now there's just one more thing which is about whether there is a conflict between what Narayan mentioned earlier because he said that maybe it might not be possible to treat your test code exactly as your production code so there's somebody who wants to know what your views are about this topic sorry can you repeat again someone here wants to know that like in the previous talk Narayan mentioned that it might not be possible to treat test code as production code always so what are your views on that so as I mentioned it might not be possible to treat the test code almost as equal to the production code at least let's try to bring it to the level of production code so what I meant what when anyone says that you treat test code as production code it just means that the principles that you are trying to apply for production code for example writing creating or maintaining your test code separate feature branches not merging them directly into your master branch then having some checks on your poll requests so that issues which are very obvious they are found right when the poll request is created then maybe one of the observations are the points which I also got when I conducted the unit testing session long back for the test chat community was that it is always possible to add unit or integration tests for test framework because there is not enough time for that for test engineers agree but then you can always plan for it at some point of time like what I mentioned is tech debt so tech debt is something which you always plan for and as a test engineering team even if you are working with your even if you are working as a dedicated tester in a team or if you are working as a separate you can always plan for fixing the tech debt in the future so I mean I did not get a chance to look at Narayan's talk so I do not have a deeper context but I just feel that we can try as much as possible to treat our test code as production code I think that is fair and I think that is what he meant as well Abhijeet wonderful session thank you really thank you very much