Along the line $x+y=1$ we have $dy=-dx$, so $\int_{\gamma}y^2dx+x^2dy=\int_1^0 \left((1-x)^2-x^2\right) dx=\int_0^1(2x-1)\,dx=\left[x^2-x\right]_0^1=0.$
If the curve were closed, we could use Green's theorem: $\int_{\partial R}Ldx+Mdy= \int_R\left( \frac{\partial M}{\partial x}- \frac{\partial L}{\partial y} \right)\,dx\,dy$ while if the $1$-form $\omega=y^2dx+x^2dy$ were the exterior derivative $\omega=df$ of a potential (a smooth function) or $0$-form $f(x,y)$, then the integral would be $f(0,1)-f(1,0)$ by Stokes' theorem, which generalizes the fundamental theorem of calculus and has the physical interpretation of work as a change in potential energy, as @DavidMitra points out. However, neither of these apply in our case.
If we view $\omega$ in stead as a vector field $\mathbf{F}=(y^2,x^2)$, then there exists a potential $f$ so that $\mathbf{F}=\nabla f$ iff $\mathbf{F}$ is conservative, i.e., iff the scalar curl of $\mathbf{F}$, $\frac{\partial F_2}{\partial x}-\frac{\partial F_1}{\partial y}$, vanishes. In such a case, the integral is path-independent and the result is the difference in potential; in our case however, once again, this doesn't help, since $\nabla\times\mathbf{F}=2(x-y)\hat{k}\ne\vec{0}$.
In our case, the path conspires with the form $\omega$ or vector field $\mathbf{F}$ to produce a vanishing result. If we integrated along line $x+y=a\ne0,1$ from $(a,0)$ to $0,a$, we would get $ \int_0^a(2ax-a^2)\,dx=a\left[x^2-ax\right]_0^1=a(1-a)\ne0\,, $ while if we used in stead the path along the axes from $(a,0)$ via $(0,0)$ to $(0,a)$, we would get $0$.